@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | protected function totalAmountResourceCallable() |
68 | 68 | { |
69 | - return function () { |
|
69 | + return function() { |
|
70 | 70 | $idKey = $this->getDataModel()->getKeyName(); |
71 | 71 | |
72 | 72 | return $this->getDataModel()->query()->get([$idKey])->count(); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | protected function listResourceCallable() |
89 | 89 | { |
90 | - return function () { |
|
90 | + return function() { |
|
91 | 91 | return EloquentHelper::paginate($this->serializer, $this->getDataModel()->query())->get(); |
92 | 92 | }; |
93 | 93 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | */ |
123 | 123 | protected function findResourceCallable(Request $request) |
124 | 124 | { |
125 | - return function () use ($request) { |
|
125 | + return function() use ($request) { |
|
126 | 126 | $idKey = $this->getDataModel()->getKeyName(); |
127 | 127 | |
128 | 128 | return $this->getDataModel()->query()->where($idKey, $request->id)->first(); |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | protected function createResourceCallable() |
154 | 154 | { |
155 | - return function (array $data, array $values) { |
|
155 | + return function(array $data, array $values) { |
|
156 | 156 | $model = $this->getDataModel()->newInstance(); |
157 | 157 | |
158 | 158 | foreach ($values as $attribute => $value) { |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | */ |
203 | 203 | protected function updateResourceCallable() |
204 | 204 | { |
205 | - return function (Model $model, array $values, ErrorBag $errorBag) { |
|
205 | + return function(Model $model, array $values, ErrorBag $errorBag) { |
|
206 | 206 | foreach ($values as $attribute => $value) { |
207 | 207 | $model->$attribute = $value; |
208 | 208 | } |
@@ -20,7 +20,6 @@ |
||
20 | 20 | protected function buildMapping($mappedClass) |
21 | 21 | { |
22 | 22 | return (\is_string($mappedClass) && \class_exists($mappedClass, true)) ? |
23 | - MappingFactory::fromClass($mappedClass) : |
|
24 | - MappingFactory::fromArray($mappedClass); |
|
23 | + MappingFactory::fromClass($mappedClass) : MappingFactory::fromArray($mappedClass); |
|
25 | 24 | } |
26 | 25 | } |
@@ -45,11 +45,11 @@ |
||
45 | 45 | $this->mergeConfigFrom(__DIR__.self::PATH, 'jsonapi'); |
46 | 46 | $this->app->singleton( |
47 | 47 | JsonApiSerializer::class, |
48 | - function ($app) { |
|
48 | + function($app) { |
|
49 | 49 | $mapping = $app['config']->get('jsonapi'); |
50 | 50 | $transformer = new JsonApiTransformer(self::parseRoutes(new Mapper($mapping))); |
51 | 51 | |
52 | - $cacheableConfig = function () use ($transformer) { |
|
52 | + $cacheableConfig = function() use ($transformer) { |
|
53 | 53 | return new JsonApiSerializer($transformer); |
54 | 54 | }; |
55 | 55 |