28 lines
661 B
PHP
28 lines
661 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Brand;
|
|
use App\Models\Partner;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
use Illuminate\Support\Str;
|
|
|
|
/**
|
|
* @extends Factory<Brand>
|
|
*/
|
|
class BrandFactory extends Factory
|
|
{
|
|
protected $model = Brand::class;
|
|
|
|
public function definition(): array
|
|
{
|
|
$name = fake()->company().' '.fake()->randomElement(['Design', 'Living', 'Home']);
|
|
|
|
return [
|
|
'partner_id' => Partner::factory()->manufacturer(),
|
|
'name' => $name,
|
|
'slug' => Str::slug($name).'-'.fake()->unique()->numberBetween(100, 999),
|
|
'is_active' => true,
|
|
];
|
|
}
|
|
}
|