bitfumes / laravel-multiauth

Multi Auth and admin auth in Laravel Project
MIT License
471 stars 104 forks source link

factory error while installing in laravel 9 #174

Open malozaibi opened 2 years ago

malozaibi commented 2 years ago

Describe the bug I get Target class [Illuminate\Database\Eloquent\Factory] does not exist. error while installing in Laravel 9.

Laravel Version Laravel 9

jigumany commented 1 year ago

Use this solution

!!!the loadFactoriesFrom method should not be used, it's deprecated and it will be removed from Laravel in a future version!!!

What you should do, is overwrite the newFactory() method, that the HasFactory trait provides, and just register the factory there. I would be happier for a more "global" solution but this seems to be a good solution and doing it the way laravel intended it to. Hacking stuff will bite you in the future :)

/**