Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
createRequest
0.00% covered (danger)
0.00%
0 / 7
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 / 6
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 createRequest 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'          => 'required|string|unique:users',
33            'name'              => 'required|string',
34            'password'          => 'required|string|min:6',
35            'confirm_password'  => 'required|string|same:password',
36        ];
37    }
38}