%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /mnt/tnb2/git/loslex/app/Http/Requests/
Upload File :
Create Path :
Current File : //mnt/tnb2/git/loslex/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|string|email|max:255|unique:users,email,'.$this->user()->id,
            'phone_number' =>   ['nullable','string','regex:/(\+42[01])?\d{9}/'],
            'licence_number' => ['nullable','string','regex:/^(AL|ZP)\d{6}$/i'],
            'lex_hash' =>       'nullable|alpha_num|ascii|max:8'
        ];
    }
}

Zerion Mini Shell 1.0