-
Notifications
You must be signed in to change notification settings - Fork 0
/
_ide_helper_macros.php.stub
98 lines (91 loc) · 3.15 KB
/
_ide_helper_macros.php.stub
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
/**
* A helper file for Laravel, to provide autocomplete information to your IDE
* This file should not be included in your code, only analyzed by your IDE!
*
* @author Igor Moraes <[email protected]>
* @see https://github.com/igorsgm/laravel-api-responses
*/
namespace Illuminate\Contracts\Routing;
class ResponseFactory
{
/**
* Return a new success JSON response from the application.
*
* Called like: response()->success(...)
*
* @param array $data
* @param string $message
* @param int $status
* @param array $headers
* @return \Illuminate\Http\JsonResponse
* @see \Igorsgm\LaravelApiResponses\Macros\Success::run()
*/
public function success($data = [], $message = '', $status = 200, $headers = [])
{
return \Illuminate\Routing\ResponseFactory::success($data, $message, $status, $headers);
}
/**
* Return a success JSON message response from the application.
*
* Called like: response()->successMessage(...)
*
* @param string $message
* @param int $status
* @param array $headers
* @return \Illuminate\Http\JsonResponse
* @see \Igorsgm\LaravelApiResponses\Macros\SuccessMessage::run()
*/
public function successMessage($message = '', $status = 200, $headers = [])
{
return \Illuminate\Routing\ResponseFactory::successMessage($message, $status, $headers);
}
/**
* Return a new error JSON response from the application.
*
* Called like: response()->error(...)
*
* @param array $errors
* @param string $message
* @param int $status
* @param array $headers
* @param array $debugData
* @return \Illuminate\Http\JsonResponse
* @see \Igorsgm\LaravelApiResponses\Macros\Error::run()
*/
public function error($errors = [], $message = '', $status = 500, $headers = [], $debugData = [])
{
return \Illuminate\Routing\ResponseFactory::error($errors, $message, $status, $headers, $debugData);
}
/**
* Return an error JSON message from the application.
*
* Called like: response()->successMessage(...)
*
* @param string $message
* @param int $status
* @param array $headers
* @return \Illuminate\Http\JsonResponse
* @see \Igorsgm\LaravelApiResponses\Macros\ErrorMessage::run()
*/
public function errorMessage($message = '', $status = 500, $headers = [])
{
return \Illuminate\Routing\ResponseFactory::errorMessage($message, $status, $headers);
}
/**
* Return a new error JSON response from the application coming from an exception.
*
* Called like: response()->exceptionError(...)
*
* @param \Throwable $exception
* @param string $message
* @param int $status
* @param array $headers
* @return \Illuminate\Http\JsonResponse
* @see \Igorsgm\LaravelApiResponses\Macros\ExceptionError::run()
*/
public function exceptionError($exception, $message = '', $status = 0, $headers = [])
{
return \Illuminate\Routing\ResponseFactory::exceptionError($exception, $message, $status, $headers);
}
}