Groovel blog : The platform for web artisans


Welcome

Common mistakes that other can have when migrate to Laravel version 5.2 and that i had and solved:-)

by groovel

Posted on 2016-06-09 19:26:39


Common mistake that other can have when migrate to version 5.2 and that i have :-)
1. 'Form'=> Illuminate\Html\FormFacade::class,
'HTML'=> Illuminate\Html\HtmlFacade::class are no more supported by Laravel, otherwise you can see laravelcollective https://laravelcollective.com

2. In blade php, when using section, i had got the following error:
Cannot end a section without first starting one, => solution remove @stop or @endsection

3. In my blade template $errors not appearing=>solution :
Route::group(['middleware' => ['web']], function () {
    //add your routes here
    })
 $errors is now included in session by the middleware!.

 
4. Upgrading from 5.0 to 5.2 filters before and after are no more supported and replaced by middleware!! great new functionality!    
    
5. From version under 5: the hardest work is too migrate the blade to the new directive  {!! !!}.

6. Other things
In ajax called don't forget to put the token csrf_token() in L5.2 or in your form if you don't use HTML:Form

7. How to pass parameters between middleware?

for example i've got a middleware that checks rules of users , second middleware loads contents that users can access, the only way i found is to set the user's rules into the session and that second middleware can pull.



It is just some little things, the upgrade guide  https://laravel.com/docs/5.2/upgrade is very well documented!


Leave a Comment: