Tag: Laravel

  • How to easily set a custom redirect in Laravel form requests

    How to easily set a custom redirect in Laravel form requests

    In Laravel you can create custom request classes where you can house the validation for any given route. If that validation then fails, Laravel’s default action is to redirect the visitor back to the previous page. This is commonly used for when a form is submitted incorrectly – The visitor will be redirected back to…

  • Digging into laravel is fun. Just made my first little generator tool. Laravel makes everything so bloody easy!

  • Laravel Blade push and stack

    Laravel’s blade view compiler is second to none. I’ve used a couple of different templating engines and blade is by far my favourite. Including Partials The way in which we include partials of views within our main views is as follows:@include(‘partials.my-first-partial’)It will inject that partial’s content in the specified place. Defining Sections Within our views,…

  • Laravel global query scopes were the answer I needed when working out how to deal with post types in a clean way.

  • Great to see @laravelphp has reinstated auth/register functionality as an artisan command in 5.2

  • Updated to PHP7 and got white screen where was fine before. It was @laravelphp blade comment block causing. Deleting comment block fixed it. Just mentioned in case anybody else had a similar issue.

  • Starting a new personal project tonight. Finally a medium-sized project idea that I want to build. And one to really dig into Laravel.

  • Normally, with Laravel (@laravelphp on Twitter), if you create a model and use the “-m” or “–migration” flag to create the accompanying migration, it will pluralize the table. So for example “User” model will use a “users” table; “Vehicle” model will use a “vehicles” table. I just discovered however, that if you create a “Data”…

  • On rethinking my database structure

    I’ve been using Laravel for my personal website for about eight months now and haven’t looked back since. This huge advantage to my rebuilding it in that way — from its original WordPress foundations — was that I had a crash course in using Laravel as well as learning some best practices as well. Now…

  • Rewriting my database structure is proving more work than first thought. Still – I’ve learnt some new Laravel stuff which is always good. So even if it never ends up being used, it’s not been a wasted exercise.

  • Bypassing Laravel’s CSRF Middleware on selected routes (from 5.1)

    A handy way to have some of your routes skip the middleware for CSRF protection. Handy in some situations.

  • With each extra Laravel component I pull in to use, I increasing think – why not just use Laravel? I then have to remind myself that this whole thing I’m building is an experiment and a learning exercise, so it’s okay.