bazar
bazar copied to clipboard
Declaration of Illuminate\Database\Eloquent\Factories\HasFactory::newFactory() must be compatible with Bazar\Models\User::newFactory(): ?Bazar\Database\Factories\UserFactory
- Bazar Version: 0.9.1
- Laravel Version: 8.53.1
- PHP Version: 7.4.22
- Database Driver & Version: mysql 14.14
Description:
During registration the following error occures:
Declaration of Illuminate\Database\Eloquent\Factories\HasFactory::newFactory() must be compatible with Bazar\Models\User::newFactory(): ?Bazar\Database\Factories\UserFactory
Steps To Reproduce:
- fresh laravel installation
- install laravel/breeze
- install conedevelopment/bazar
- extending the default user model
- defining admins
- register a new user
Got the same error but realized that Bazar'Models\User uses hasFactory too. Just remove 'hasFactory' from your projects User Model.
Works fine after removing the HasFactory trait from User model, thx @mwamodo !