<?php

namespace App\Http\Requests\Admin;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Str;

class StoreRouletteCategoryRequest extends FormRequest
{
    public function authorize(): bool
    {
        return $this->user()->can('roulette.manage');
    }

    public function rules(): array
    {
        return [
            'name' => ['required', 'string', 'max:50'],
        ];
    }

    public function slug(): string
    {
        return Str::slug($this->validated('name'));
    }
}
