Attempting to utilise the new class based factories had me scratching my head for the best part of an afternoon. In the background Laravel is looking in the application Factories folder and so doesn’t see the ones in your package.
If you want to go down the rabbit hole start in Illuminate\Database\Eloquent\Factories\HasFactory trait and follow it to Illuminate\Database\Eloquent\Factories speciallycheck out resolveFactoryName on Line 680 Illuminate\Database\Eloquent\Factoriesfor a . There are two approaches which I’ve had success with.
Within the Models you wish to have Factories you add the following method with the full path to the Models Factory.