-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve support for Factories #201
Conversation
@sephyld how did you manage to use this before this PR? |
@LukeTowers should I move the |
Hi @mjauvin. If you are referring to the factory not managing to resolve the model's class name, I just specify the model class using the <?php
namespace Winter\Demo\Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Winter\Demo\Models\ModelKlass;
/**
* ModelKlassFactory Factory
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\Winter\Demo\Models\ModelKlass>
*/
class ModelKlassFactory extends Factory
{
protected $model = ModelKlass::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition()
{
return [
// factory definition
];
}
} In hindsight, I think I should have added it in the PR that took care of the create:factory command. Sorry. If you want, I can take care of it now |
Actually, I'm referring to the Model not resolving the Factory. i.e. |
I see. I didn't think about that, I never use the model class to resolve its factory. I only use the factory class directly |
@sephyld if you're able to improve the magic in Winter at all that would be much appreciated ❤️ |
No description provided.