<?php

namespace Database\Factories;

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

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

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