So long story short, I have a model in my Larvel 8 (Jetstream) application called Board. I am trying to generate a factory for this Board model.
When I use either of the commands below:
php artisan make:factory BoardFactory
or
php artisan make:factory BoardFactory --model=Board
I get a factory class generated with seemingly no errors or issues. However, when I open the class it contains nothing to do with the model.
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
class BoardFactory extends Factory{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
//
];
}
}
I have tried this with all the Model's within my application and this persists. Once again no error to say the model is not found. The command seemingly runs successfully but obviously hasn't generated the factory for the Model.
I know I can easily write this manually if needs be, but I would like to understand why this isn't working and how I can fix it. The faster I can get through my testing... the better :)
Thanks in advance for any help.