@@ -30,28 +30,28 @@ |
||
30 | 30 | { |
31 | 31 | use IncludesRelations, HandlesLimit; |
32 | 32 | |
33 | - public $include = []; |
|
33 | + public $include = [ ]; |
|
34 | 34 | |
35 | - public $available = []; |
|
35 | + public $available = [ ]; |
|
36 | 36 | |
37 | 37 | public $limit = -1; |
38 | 38 | |
39 | - public function __construct($resource, $relations = []) |
|
39 | + public function __construct($resource, $relations = [ ]) |
|
40 | 40 | { |
41 | 41 | if (!($resource instanceof Model)) { |
42 | 42 | throw new Exception('Object passed to the transformer resource method is not a eloquent model', 500); |
43 | 43 | } |
44 | 44 | $this->resource = $resource; |
45 | - $relations = is_array($relations) ? $relations : []; |
|
45 | + $relations = is_array($relations) ? $relations : [ ]; |
|
46 | 46 | parent::__construct(self::loadRelations($resource, $relations)); |
47 | 47 | } |
48 | 48 | |
49 | - public static function resource($model, array $relations = []): self |
|
49 | + public static function resource($model, array $relations = [ ]): self |
|
50 | 50 | { |
51 | 51 | return new static($model, $relations); |
52 | 52 | } |
53 | 53 | |
54 | - public static function collection($resource, array $relations = []) |
|
54 | + public static function collection($resource, array $relations = [ ]) |
|
55 | 55 | { |
56 | 56 | if (!($resource instanceof Collection)) { |
57 | 57 | throw new Exception('Object passed to the transformer collection method is not a collection', 500); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | 'production' => [ |
75 | 75 | 'supervisor-1' => [ |
76 | 76 | 'connection' => 'redis', |
77 | - 'queue' => ['default'], |
|
77 | + 'queue' => [ 'default' ], |
|
78 | 78 | 'balance' => 'simple', |
79 | 79 | 'processes' => 10, |
80 | 80 | 'tries' => 3, |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | 'local' => [ |
85 | 85 | 'supervisor-1' => [ |
86 | 86 | 'connection' => 'redis', |
87 | - 'queue' => ['default'], |
|
87 | + 'queue' => [ 'default' ], |
|
88 | 88 | 'balance' => 'simple', |
89 | 89 | 'processes' => 3, |
90 | 90 | 'tries' => 3, |
@@ -58,32 +58,32 @@ |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | if ($unwrap) { |
61 | - return json_decode($content, true)['data'] ?? json_decode($content, true); |
|
61 | + return json_decode($content, true)[ 'data' ] ?? json_decode($content, true); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | return json_decode($content, true); |
65 | 65 | } |
66 | 66 | |
67 | - protected function http(string $method, string $route, array $payload = []) |
|
67 | + protected function http(string $method, string $route, array $payload = [ ]) |
|
68 | 68 | { |
69 | 69 | return $this->sendRequest($method, $route, $payload, true); |
70 | 70 | } |
71 | 71 | |
72 | - private function sendRequest(string $method, string $route, array $payload = [], $authenticated = true): \Illuminate\Foundation\Testing\TestResponse |
|
72 | + private function sendRequest(string $method, string $route, array $payload = [ ], $authenticated = true): \Illuminate\Foundation\Testing\TestResponse |
|
73 | 73 | { |
74 | 74 | return $this->json($method, env('API_URL').$route, $payload, $authenticated ? [ |
75 | 75 | 'Authorization' => 'Bearer '.$this->getAuth0Service()->getTestUserToken()->id_token, |
76 | - ] : []); |
|
76 | + ] : [ ]); |
|
77 | 77 | } |
78 | 78 | |
79 | - protected function sendRequestWithToken($token, string $method, string $route, array $payload = [], $authenticated = true): \Illuminate\Foundation\Testing\TestResponse |
|
79 | + protected function sendRequestWithToken($token, string $method, string $route, array $payload = [ ], $authenticated = true): \Illuminate\Foundation\Testing\TestResponse |
|
80 | 80 | { |
81 | 81 | return $this->json($method, env('API_URL').'/'.$route, $payload, $authenticated ? [ |
82 | 82 | 'Authorization' => 'Bearer '.$token, |
83 | - ] : []); |
|
83 | + ] : [ ]); |
|
84 | 84 | } |
85 | 85 | |
86 | - protected function httpNoAuth(string $method, string $route, array $payload = []) |
|
86 | + protected function httpNoAuth(string $method, string $route, array $payload = [ ]) |
|
87 | 87 | { |
88 | 88 | return $this->sendRequest($method, $route, $payload, false); |
89 | 89 | } |
@@ -30,10 +30,10 @@ |
||
30 | 30 | protected $middlewareGroups = [ |
31 | 31 | 'web' => [ |
32 | 32 | //\Foundation\Middleware\EncryptCookies::class, |
33 | - //\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, |
|
34 | - //\Illuminate\Session\Middleware\StartSession::class, |
|
35 | - //\Illuminate\View\Middleware\ShareErrorsFromSession::class, |
|
36 | - //\Foundation\Middleware\VerifyCsrfToken::class, |
|
33 | + //\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, |
|
34 | + //\Illuminate\Session\Middleware\StartSession::class, |
|
35 | + //\Illuminate\View\Middleware\ShareErrorsFromSession::class, |
|
36 | + //\Foundation\Middleware\VerifyCsrfToken::class, |
|
37 | 37 | //\Illuminate\Routing\Middleware\SubstituteBindings::class, |
38 | 38 | ], |
39 | 39 |