Conditions | 1 |
Paths | 1 |
Total Lines | 18 |
Lines | 18 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
15 | View Code Duplication | public function run($factory) |
|
16 | { |
||
17 | $factory->macro('errorMessage', |
||
18 | /** |
||
19 | * Return an error JSON message from the application. |
||
20 | * Called like: response()->successMessage(...) |
||
21 | * |
||
22 | * @param string $message |
||
23 | * @param int $status |
||
24 | * @param array $headers |
||
25 | * @return JsonResponse |
||
26 | */ |
||
27 | function ($message = '', $status = HttpResponse::HTTP_INTERNAL_SERVER_ERROR, array $headers = []) use ( |
||
28 | $factory |
||
29 | ) { |
||
30 | return $factory->error([], $message, $status, $headers); |
||
31 | }); |
||
32 | } |
||
33 | } |
||
34 |