conedevelopment/bazar

Declaration of Illuminate\Database\Eloquent\Factories\HasFactory::newFactory() must be compatible with Bazar\Models\User::newFactory(): ?Bazar\Database\Factories\UserFactory

Closed this issue · 2 comments

  • 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:

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 !