I am having this error when moving User.php
to Models/User.php
local.ERROR: Symfony\\Component\\Debug\\Exception\\FatalThrow
These answers aren't right, you don't need to change the namespace to \App\Models\User. The autoload will load the models folder but the class can still be class User
and the namespace should still be App
. Is that how it is set up in your file?
namespace App;
class User extends Model {}
I have got the same kind of issue a few days back. So I did this: Run this command
php artisan config:cache
php artisan config:clear
And it solved my issue.Most of the issues are solved by this. I recommend to try this first and if this doesn't solve your issue then go for other hacks.
If the app config is cached, it may not be able to get the new configuration, because config:cache gives this error before clearing and caching configuration, so just delete the cache manually:
rm bootstrap/cache/config.php
What solved it for me was to change:
'model' => '{YourAppName}\User',
I finally was able to resolve it by changing this the following code.
array (
'driver' => 'eloquent',
'model' => 'App\\Models\User',
),
Reload composer autloaded classes.
composer dump-autoload