%PDF- %PDF-
Direktori : /home/silvzytp/calling_code/app/Http/Requests/ |
Current File : /home/silvzytp/calling_code/app/Http/Requests/AdminRequest.php |
<?php namespace App\Http\Requests; use Illuminate\Foundation\Http\FormRequest; class AdminRequest 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; } }