Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
peripherad
/
app
/
Http
/
Requests
/
Admin
:
UpdateProfileRequest.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php namespace App\Http\Requests\Admin; use Gate; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Http\Response; class UpdateProfileRequest 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 */ public function rules() { return [ 'name' => ['required', 'string', 'max:50'], // 'email' => ['required', 'string', 'email', 'max:255', 'unique:users,email,' . auth()->id()], 'phone_number' => ['required_if:sms_notification,1', 'nullable', 'max:20'], 'company' => ['nullable', 'max:20'], 'fax_number' => ['nullable', 'max:20'], 'password' => ['nullable', 'confirmed', 'regex:/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[a-zA-Z]).{8,}$/i'], 'profile_image' => [ 'nullable', 'mimes:jpg,gif,png', 'max:4096' ], ]; } public function messages() { return [ 'password.regex' => 'Password should contain at least 8 characters, one letter, one number & one special character', 'phone_number.required_if' => 'You must provide phone number in order to receive SMS notifications.', 'phone_number.integer' => 'Phone number can only contain numbers.', ]; } }