Solved
dogstring

Jun 3rd, 2019 11:25 PM

I was attempting to create a user via admin dashboard -> users -> add user but after filling the information and hit Save button I am always getting a 500 | server error. I've check the laravel log and I am getting this error .

[2019-06-04 01:24:44] local.ERROR: Call to a member function toJson() on null {"userId":1,"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Call to a member function toJson() on null at /home/vagrant/code/wave_rnd/vendor/tcg/voyager/src/Models/User.php:30)

I can't fix because its a package from voyager.

andrewo0

Jun 4th, 2019 03:53 AM

Best Answer

Hi dogsting

this is an issue in voyager 1.2 why not upgrade to a nother version of voyager?

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

in App\User and in /admin/bread/users/edit

dogstring

Jun 9th, 2019 05:40 AM

I checked the voyager github but it says its current on 1.2.*

https://docs.laravelvoyager.com/getting-started/upgrading

I did upgrade thought but I still get the same error.

andrewo0

Jun 12th, 2019 05:21 AM

have you tryed the fix?

dogstring

Jul 17th, 2019 11:02 PM

all done thanks :)

jayb

Jul 24th, 2019 03:55 PM

Hi andrew0, where did you mean when you say "and in /admin/bread/users/edit"? I'm having the same issue, I've added to App\User and it seems to be working but I don't want it to pop up again becuase I missed something. For note, voyager was installed as a requirement for Wave via composer.

kelerein-maarteina

Nov 7th, 2019 01:02 AM

This is very common error. I have been facing it on my previous server MyColes.com.au. Now I have found the solution here. Thanks for the solution.