To update to the latest version inside of your composer.json file make sure to update the version of voyager inside the require declaration inside of your composer.json to:
And then run
You will now need to run the following migrations to include new tables or rows that have been added to the latest version. you can find each of these migrations below:
You can do this by adding each of those migrations to your
database/migrations folder and then run
php artisan migrate
voyager.php configuration file has had a few changes. The
prefix key has been removed in favor of the
user.redirect key. Please note that the
user.redirect key should be prefixed with a slash (
/), unlike the original
Multi-roles is a new feature come by in v1.1 that allows you to have multiple roles and one primary role. You can fetch the user's primary role like normally using this:
$user->role->name // Name of primary role
But now you can also use the new belongsToMany roles relationship to fetch all extra roles:
$user->roles() // gets all extra roles relationship$user->roles()->get() // gets all extra as a collection
Besides that there is a helper to get all the roles, both the primary and the extra roles:
$user->roles_all() // collection of all roles
Please note, that you do not have to use the multi-roles and you can continue to use the primary role without any changes.
Also, make sure that you add the new data row into the database for the
users data type. Insert a new row of data in the
data_rows table. Make sure that it's
data_type_id is the ID for the
users data type, normally this would be ID
3, but better make sure it is correct.
Then make sure the other fields are like below:
The BREAD and Database section in Voyager has been separated into two sections. So in order to get access to the BREAD section using the menu, make sure to add the following menu item:
However, you might still not be able to see it, because it requires permission, so go ahead and create a new row in the
permissions table with the
browse_bread, leave the
table_name to be
You should now be able to access the BREAD section.
If you have not translated any of the Voyager language strings, you may skip this step.
Voyager have changed its translations strings from being like
__('voyager.generic.close') to be prefixed with the
Meaning that you would have to update your translated strings inside
resources/lang/LOCALE.json to use the new prefix.
Next, you may want to be sure that you have all the latest published assets. To re-publish the voyager assets you can run the following command:
php artisan vendor:publish --tag=voyager_assets --force
Then you may wish to clear your view cache by running the following command:
php artisan view:clear
Be sure to ask us on our slack channel if you are experiencing any issues and we will try and assist. Thanks.