%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/silvzytp/calling_code/app/Http/Requests/
Upload File :
Create Path :
Current File : /home/silvzytp/calling_code/app/Http/Requests/ManagerRequest.php

<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class ManagerRequest 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:6','max:16'],
            'status'    => ['required','in:1,2'],
            'profile'   => ['nullable','mimes:png,jpg']
        ];

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


        return $rules;
    }


}

Zerion Mini Shell 1.0