so when using the new model factories class introduced in laravel 8.x, ive this weird issue saying that laravel cannot find the factory that corresponds to the model. i get
Today I have got below issue after upgrading my project from Laravel 7 to Laravel 8 and updating it online on server.
Trait 'Illuminate\Database\Eloquent\Factories\HasFactory' not found
Even I have updated composer.json with autoload directive given in answer by @lagbox but it did not resolved the issue for me.
Finally I have updated complete vendors folder online that have resolved my issue.
Hope it helps someone in future!