Upgrade from 3.2 to 4.0ΒΆ
Important
Laratrust 4.0 requires Laravel >= 5.1.40.
In order to upgrade from Laratrust 3.3 to 4.0 you have to follow these steps:
Change your
composer.jsonto require the 4.0 version of Laratrust:"santigarcor/laratrust": "4.0.*"
Run
composer updateto update the source code.Update your
config/laratrust.php:3.1. Backup your
config/laratrust.phpconfiguration values.3.2. Delete the
config/laratrust.phpfile.3.3. Run
php artisan vendor:publish --tag=laratrust.3.4. Update the
config/laratrust.phpfile with your old values.Note
Leave the
use_teamskey in false during the upgrade process.If you use any values of the
config/laratrust.phpin your application code, update those values with the new file structure.If you use the ability middleware and you pass the third argument (require all), please change it like this:
// From 'middleware' => ['ability:admin|owner,create-post|edit-user,true'] // To 'middleware' => ['ability:admin|owner,create-post|edit-user,require_all']
Run
php artisan laratrust:upgradeto create the migration with the database upgrade.Run
php artisan migrateto apply the migration created in the previous step.Delete the
LaratrustSeeder.phpfile and runphp artisan laratrust:seeder.Run
composer dump-autoload.
Now you can use the 4.0 version without any problem.