20-02-2026
This commit is contained in:
parent
854ce02bf6
commit
4d6b4930b2
128 changed files with 18247 additions and 2093 deletions
28
database/factories/BrandFactory.php
Normal file
28
database/factories/BrandFactory.php
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?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,
|
||||
];
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue