Upgrade from 3.1 to 3.2ΒΆ
In order to upgrade from Laratrust 3.1 to 3.2 you have to follow these steps:
Change your
composer.json
to require the 3.2 version of laratrust:"santigarcor/laratrust": "3.2.*"
Run
composer update
to update the source code.Add in your
config/laratrust.php
file this block:'user_models' => [ 'users' => 'App\User', ],
And configure it with you user models information according to the new Multiple User Models explanation.
Run
php artisan laratrust:add-trait
to add theLaratrustUserTrait
to the user models.Run
php artisan laratrust:upgrade
to create the migration with the database upgrade.Run
php artisan migrate
to apply the migration created in the previous step.Delete the
LaratrustSeeder.php
file and runphp artisan laratrust:seeder
.Run
composer dump-autoload
.
Now you can use the 3.2 version without any problem.