@@ -42,11 +42,11 @@ |
||
42 | 42 | public function register() |
43 | 43 | { |
44 | 44 | $this->mergeConfigFrom(__DIR__.self::PATH, 'jsonapi'); |
45 | - $this->app->singleton(\NilPortugues\Laravel5\JsonSerializer\JsonSerializer::class, function ($app) { |
|
45 | + $this->app->singleton(\NilPortugues\Laravel5\JsonSerializer\JsonSerializer::class, function($app) { |
|
46 | 46 | $mapping = $app['config']->get('jsonapi'); |
47 | 47 | $key = md5(json_encode($mapping)); |
48 | 48 | |
49 | - return Cache::rememberForever($key, function () use ($mapping) { |
|
49 | + return Cache::rememberForever($key, function() use ($mapping) { |
|
50 | 50 | return new JsonSerializer(new JsonTransformer(self::parseRoutes(new Mapper($mapping)))); |
51 | 51 | }); |
52 | 52 | }); |
@@ -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 | } |
@@ -39,7 +39,7 @@ |
||
39 | 39 | $value = $reflection->newInstanceWithoutConstructor(); |
40 | 40 | |
41 | 41 | if (is_subclass_of($value, Model::class, true)) { |
42 | - $attributes = array_merge( |
|
42 | + $attributes = array_merge( |
|
43 | 43 | Schema::getColumnListing($value->getTable()), |
44 | 44 | self::getRelationshipMethodsAsPropertyName($value, $className, $reflection) |
45 | 45 | ); |