Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
updateRequest
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 2
6
0.00% covered (danger)
0.00%
0 / 1
 authorize
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 rules
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace App\Http\Requests\Api\user;
4
5use App\Traits\requestApiTrait;
6use App\Traits\response;
7use Illuminate\Foundation\Http\FormRequest;
8use Illuminate\Contracts\Validation\Validator;
9use Illuminate\Http\Exceptions\HttpResponseException;
10
11class updateRequest extends FormRequest
12{
13    use requestApiTrait;
14    /**
15     * Determine if the user is authorized to make this request.
16     *
17     * @return bool
18     */
19    public function authorize()
20    {
21        return true;
22    }
23
24    /**
25     * Get the validation rules that apply to the request.
26     *
27     * @return array<string, mixed>
28     */
29    public function rules()
30    {
31        return [
32            'username'             => 'nullable|string|max:255|unique:users,username,'. auth('user_api')->user()->id,
33            'name'                 => 'nullable|string|max:250',
34        ];
35    }
36}