%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/silvzytp/ccd-ind-code/app/Http/Requests/
Upload File :
Create Path :
Current File : /home/silvzytp/ccd-ind-code/app/Http/Requests/AgentRequest.php

<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class AgentRequest extends FormRequest
{

    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array<string, mixed>
     */
    public function rules()
    {
        $rules = [
            'full_name'   => ['required','string','max:100'],
            'role'        => ['required','integer'],
            'email'       => ['required','email','unique:users,email'],
            'phone'       => ['nullable','max:20'],
            'password'    => ['required','min:8','max:16'],
            'description' => ['nullable','max:300'],
        ];

        if (request()->updated_at) {
            $rules['email'][2] = 'unique:users,email,'.request()->updated_at;
        }

        return $rules;
    }


}

Zerion Mini Shell 1.0