Wave Upgrade to Laravel 5.8 and Voyager 1.2

tnylea

Apr 2nd, 2019 09:23 PM

You can download the latest version of Wave which has been updated from Laravel 5.6 to 5.8. Voyager 1.0 has been upgraded to 1.2.

It's a pretty simple update, here are the steps to update. Also documented in the documentation:

Upgrade Steps


  1. Update DEPENDENCIES
composer update

  1. Voyager::can function is no longer available (has been replaced)

Inside of the 2 following files: resources/views/themes/bootstrap/layouts/app.blade.php resources/views/themes/uikit/layouts/app.blade.php

Change any instances of

Voyager::can('browse_admin')

to

!auth()->guest() && auth()->user()->can('browse_admin')

  1. (optional) roles id changed from integer to bigInteger

Possible option. In Voyager 1.2 the id in the roles table has changed from integer to bigInteger, so you may need to change role_id inside of the plans table to be of type bigInteger instead of integer.

Here is the file that was changed: wave\database\migrations\2018_09_22_234251_create_plans_table.php

line 22 was changed from:

$table->integer('role_id')->unsigned()->index('plans_role_id_foreign');

to:

$table->bigInteger('role_id')->unsigned()->index('plans_role_id_foreign');

Enjoy :) Thanks!

padrio

Apr 3rd, 2019 05:40 AM

Thank you very much! All steps are reproducable, but I've got some questions regarding the last step. Since the role_id type been changed to bigInt, why aren't you changing all FKs pointing onto it? Like user.role_id or user_roles.role_id

farid-bouchdak

Apr 4th, 2019 06:07 AM

Thanks Tony! My knowledge of programming is limited to copy&paste code. So this is what i did to upgrade my existing project:

  1. download Wave RC10 and unzip the file;
  2. remove existing wave directory in root of my existing project and remove composer.json;
  3. copy wave directory and composer.json from Wave RC10 to my existing project;
  4. update dependencies in CLI [composer update];
  5. change any "Voyager::can" instances in app.blade.php as described in your upgrade-instructions;
  6. clear ALL cache in CLI [php artisan optimize && php artisan cache:clear && php artisan route:cache && php artisan view:clear && php artisan config:cache]
farid-bouchdak

Apr 4th, 2019 06:17 AM

the only thing i didnt manage to get working yet is chatter and wave RC9 or RC10. i believe it is a javascript thingy, because i cant create or edit or delete a discussion. every solution that i found about js didnt solve my problem.

fabio-pinto

Apr 8th, 2019 12:14 PM

+1 @marx This happens on a fresh RC10 install too

@tnylea FYI

jahangir-mohammed

Apr 8th, 2019 06:52 PM

all fields are required except Additional Roles, if any field is empty then this bug comes into play.

jahangir-mohammed

Apr 15th, 2019 08:19 PM

@marx you are correct

mark-co

May 13th, 2019 09:15 AM

Hi, a workaround I found is this:

add this to app\User.php:

public function setSettingsAttribute($value) { $this->attributes['settings'] = $value ? $value->toJson() : null; }

and then edit the BREAD for the user and put App\User as the model.