Upgraded spark app and laravel now getting Trying to get property of non-object after log in.
Hi everyone!
So I upgraded my spark application to laravel 5.3 and newest version of spark and now I am getting
ErrorException in Billable.php line 191:
Trying to get property of non-object (View: /Applications/MAMP/htdocs/laravel3/resources/views/vendor/spark/nav/subscriptions.blade.php) (View: /Applications/MAMP/htdocs/laravel3/resources/views/vendor/spark/nav/subscriptions.blade.php) (View: /Applications/MAMP/htdocs/laravel3/resources/views/vendor/spark/nav/subscriptions.blade.php)
on all my pages after I log in.
I narrowed it down to the following line of code that if causing the problem but I dont know what could be the issue as this works fine on my other install of laravel 5.2 with a older version of spark.
There have been many small changes. I would just start comparing code with repo. I have found that the upgrade process requires a painstaking code check because of inconsistencies.
Also, I think its looking for the plan called default unless you tell it otherwise in 3.0. It seems unlikely that the template is causing the issue. Make sure Auth::user() is not the issue.
Ok so here was the fix. I had to rerun all migrations and then it worked. I guess there is some new stuff in the tables...
I also had to update my composer.json file for the latest version of cashier. I assumed that with a fresh update of spark this would have been done already...