I have this DatabaseSeeder.php:
If the above solutions doesn't work, try this one.
You may have changed the namespace (by default, it's "App").
What you need to do is to go to the composer.json
file and check this:
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
If the namespace is App like this example, this solution is not for you.
Otherwise, take the namespace you found and insert that line into your seeder class:
use NameSpaceFound\User;