Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Call to undefined method after upgrading to laravel 5.4

I have tried to upgrade my project to laravel 5.4 from 5.3 today. I added

"laravel/framework": "5.4.*",

To my composer.json and run the command composer update and then composer dump-autoload and then tested my project. It gives me this error:

Error:

FatalThrowableError in 2154f392745gf102547be138a945a11b58e5649203.php line 2: Call to undefined method Illuminate\View\Factory::getFirstLoop()

Did I miss something?

like image 919
prgrm Avatar asked Jan 25 '17 09:01

prgrm


3 Answers

Clear your compiled blade views.

php artisan view:clear
like image 182
Chris Avatar answered Nov 07 '22 23:11

Chris


  1. php artisan cache:clear

    Flush the application cache

  2. composer dump-autoload

    Generate autoload files

  3. php artisan view:clear

    Clear all compiled view files

like image 10
Vinayak Kulkarni Avatar answered Nov 07 '22 22:11

Vinayak Kulkarni


After upgrading packages and Laravel to 5.4 , you should run **

php artisan view:clear

** to avoid the mentioned error. further more you may run **

php artisan route:clear

** to flush the route cache. Additionally , you may run

php artisan optimize

at last.

like image 1
Roman Karki Avatar answered Nov 07 '22 21:11

Roman Karki