migrate template
This commit is contained in:
30
database/factories/SignatureItemFactory.php
Normal file
30
database/factories/SignatureItemFactory.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\SignatureItem;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<SignatureItem>
|
||||
*/
|
||||
class SignatureItemFactory extends Factory
|
||||
{
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'name' => fake()->words(3, true),
|
||||
'price' => fake()->randomFloat(2, 50, 1000),
|
||||
'price_unit' => 'kg',
|
||||
'description' => fake()->sentence(12),
|
||||
'image' => null,
|
||||
'sort_order' => fake()->numberBetween(0, 10),
|
||||
'is_active' => true,
|
||||
];
|
||||
}
|
||||
|
||||
public function inactive(): static
|
||||
{
|
||||
return $this->state(['is_active' => false]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user