@@ -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 | |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | protected function totalAmountResourceCallable() |
| 87 | 87 | { |
| 88 | - return function () { |
|
| 88 | + return function() { |
|
| 89 | 89 | $idKey = $this->getDataModel()->getKeyName(); |
| 90 | 90 | |
| 91 | 91 | return $this->getDataModel()->query()->get([$idKey])->count(); |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | */ |
| 108 | 108 | protected function listResourceCallable() |
| 109 | 109 | { |
| 110 | - return function () { |
|
| 110 | + return function() { |
|
| 111 | 111 | return EloquentHelper::paginate($this->serializer, $this->getDataModel()->query())->get(); |
| 112 | 112 | }; |
| 113 | 113 | } |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | */ |
| 155 | 155 | protected function findResourceCallable(Request $request) |
| 156 | 156 | { |
| 157 | - return function () use ($request) { |
|
| 157 | + return function() use ($request) { |
|
| 158 | 158 | $idKey = $this->getDataModel()->getKeyName(); |
| 159 | 159 | $model = $this->getDataModel()->query()->where($idKey, $request->id)->first(); |
| 160 | 160 | |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | */ |
| 189 | 189 | protected function createResourceCallable() |
| 190 | 190 | { |
| 191 | - return function (array $data, array $values) { |
|
| 191 | + return function(array $data, array $values) { |
|
| 192 | 192 | $model = $this->getDataModel()->newInstance(); |
| 193 | 193 | |
| 194 | 194 | foreach ($values as $attribute => $value) { |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | */ |
| 237 | 237 | protected function updateResourceCallable() |
| 238 | 238 | { |
| 239 | - return function (Model $model, array $values, ErrorBag $errorBag) { |
|
| 239 | + return function(Model $model, array $values, ErrorBag $errorBag) { |
|
| 240 | 240 | foreach ($values as $attribute => $value) { |
| 241 | 241 | $model->$attribute = $value; |
| 242 | 242 | } |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | */ |
| 297 | 297 | protected function deleteResourceCallable(Request $request) |
| 298 | 298 | { |
| 299 | - return function () use ($request) { |
|
| 299 | + return function() use ($request) { |
|
| 300 | 300 | $idKey = $this->getDataModel()->getKeyName(); |
| 301 | 301 | $model = $this->getDataModel()->query()->where($idKey, $request->id)->first(); |
| 302 | 302 | |