<?php

namespace App\Http\Requests\Frontend\Service;

use Illuminate\Foundation\Http\FormRequest;

final class ServiceRequest extends FormRequest
{
    public function authorize(): bool
    {
        return auth()->check();
    }

    /**
     * @return array<string, array<int, string>>
     */
    public function rules(): array
    {
        return [
            'role_id' => ['required', 'integer'],
        ];
    }

    public function getRoleId(): int
    {
        return (int) $this->validated('role_id');
    }
}
