# Upgrade from 5.0 to 5.1
IMPORTANT
Laratrust 5.1 requires Laravel >= 5.2.32 and php >= 5.6.0.
In order to upgrade from Laratrust 5.0 to 5.1 you have to follow these steps:
- Change your
composer.json
to require the 5.1 version of Laratrust:
"santigarcor/laratrust": "5.1.*"
Run
composer update
to update the source code.Run
php artisan config:clear
andphp artisan cache:clear
.Update your
config/laratrust.php
:4.1. Backup your
config/laratrust.php
configuration values.4.2. Delete the
config/laratrust.php
file.4.3. Run
php artisan vendor:publish --tag=laratrust
.4.4. Update the
config/laratrust.php
file with your old values.Delete the
LaratrustSeeder.php
file and runphp artisan laratrust:seeder
.If you use the method
cachedRoles
orcachedPermissions
you should stop using them and change the parts where you use them because they were deleted from theLaratrustUserTrait
andLaratrustRoleTrait
.Run
composer dump-autoload
.
Now you can use the 5.1 version without any problem.