Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
requestApiTrait | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
failedValidation | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace App\Traits; |
4 | |
5 | use App\Models\Setting; |
6 | use DateTime; |
7 | use DateTimeZone; |
8 | use Illuminate\Contracts\Validation\Validator; |
9 | use Illuminate\Http\Exceptions\HttpResponseException; |
10 | |
11 | trait requestApiTrait |
12 | { |
13 | use response; |
14 | |
15 | |
16 | public function failedValidation(Validator $validator) |
17 | { |
18 | throw new HttpResponseException($this->failed($validator->errors()->first(), 403, 'E03')); |
19 | } |
20 | } |