%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/silvzytp/crm-ind-code/app/Http/Requests/
Upload File :
Create Path :
Current File : //home/silvzytp/crm-ind-code/app/Http/Requests/SupportRequest.php

<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Contracts\Validation\Validator;
use Illuminate\Http\Exceptions\HttpResponseException;

class SupportRequest extends FormRequest
{
    protected function failedValidation(Validator $validator)
    {
        throw new HttpResponseException(
            response()->json([
                'status'=> false,
                'errors'=> $validator->errors()
            ],200)
        );
    }

    /**
     * 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()
    {
        return [
            'client_name' => 'required|string',
            'subject'   => 'required|string|max:180',
            'message'   => 'required|string|min:15'
        ];
    }
}

Zerion Mini Shell 1.0