<?php
namespace App\Http\Requests\Client;

use Illuminate\Foundation\Http\FormRequest;

class UpdateProfilClientRequest extends FormRequest
{
    public function authorize(): bool
    {
        return $this->user()->hasRole('client');
    }

    public function rules(): array
    {
        return [
            'nom_complet' => 'sometimes|string|max:255',
            'telephone_principal' => 'sometimes|string|max:20',
            'telephone_secondaire' => 'sometimes|nullable|string|max:20',
            'quartier_id' => 'sometimes|integer|exists:quartiers,id',
            'ville_id' => 'sometimes|integer|exists:villes,id,actif,1',
        ];
    }
}
