<?php

namespace Database\Factories;

use App\Models\Brand;
use Illuminate\Database\Eloquent\Factories\Factory;

class BrandFactory extends Factory
{
    protected $model = Brand::class;

    public function definition(): array
    {
        return [
            'name' => $this->faker->unique()->company(),
            'slug' => $this->faker->slug(),
            'sort_order' => function () {
                $max = Brand::max('sort_order') ?? 0;

                return $max + 1;
            },
        ];
    }
}
