%PDF- %PDF-
Direktori : /www/loslex/production/app/Http/Requests/ |
Current File : /www/loslex/production/app/Http/Requests/ProfileUpdateRequest.php |
<?php namespace App\Http\Requests; use App\Models\User; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rule; class ProfileUpdateRequest extends FormRequest { /** * Get the validation rules that apply to the request. * * @return array<string, \Illuminate\Contracts\Validation\Rule|array|string> */ public function rules(): array { return [ 'firstname' => 'required|string|max:255', 'lastname' => 'required|string|max:255', 'namesuffix' => 'nullable|string|max:10', 'city' => 'nullable|string|max:255', 'username' => 'required|string|max:255|unique:users,username,'.$this->user()->id, 'email' => 'required|email:rfc,dns|max:255|unique:users,email,'.$this->user()->id, 'phone_number' => ['nullable','string','regex:/^(\+42[01] ?)?\d{3} ?\d{3} ?\d{3}$/'], 'licence_number' => ['nullable','string','regex:/^((AL|ZP)\d{6})|(EZP-\d{5,7})$/i'], 'lex_hash' => 'nullable|alpha_num:ascii|size:8|unique:users,lex_hash,'.$this->user()->id, 'gdpr'=> 'accepted', ]; } }