plugin
plugin copied to clipboard
[Feature Request]: Update Factory Template
Feature Description
The result of a created factory:
<?php
namespace Database\Factories;
use App\Models\Cuisine;
use Illuminate\Database\Eloquent\Factories\Factory;
class CuisineFactory extends Factory
{
protected $model = Cuisine::class;
public function definition(): array
{
return [
'name' => $this->faker->name(),
];
}
}
Would it be possible for the generated factory to be based on the stub?
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Cuisine>
*/
class CuisineFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'name' => $this->faker->name(),
];
}
}