%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/klinisol/klinisol-api/app/Http/Requests/Api/v1/Patient/
Upload File :
Create Path :
Current File : /var/www/html/klinisol/klinisol-api/app/Http/Requests/Api/v1/Patient/CreatePatientRequest.php

<?php

namespace App\Http\Requests\Api\v1\Patient;

use App\Http\Requests\BaseRequest;

class CreatePatientRequest extends BaseRequest
{
    /**
     * 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',
            'surname'       => 'required|string',
            'email'         => 'required|email|unique_encrypted:patients,email',
            'phone'         => 'required|string|unique_encrypted:patients,phone',
            'hospitalIds'   => 'required|array|min:1',
            'hospitalIds.*' => 'integer|exists:hospitals,id',
            'protocolIds'   => 'required|array|min:1',
            'protocolIds.*' => 'integer|exists:protocols,id',
        ];
    }

    public function messages()
    {
        return [
            'hospitalIds.*.exists'   => 'Hospital does not exist!',
            'protocolIds.*.exists'   => 'Protocol does not exist!',
            'email.unique_encrypted' => 'The email has already been taken!',
            'phone.unique_encrypted' => 'The phone has already been taken!',
        ];
    }
}

Zerion Mini Shell 1.0