@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | */ |
24 | 24 | public function getRelations():array |
25 | 25 | { |
26 | - return array_merge($this->getAvailableIncludes(), $this->getDefaultIncludes()); |
|
26 | + return array_merge( $this->getAvailableIncludes(), $this->getDefaultIncludes() ); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
@@ -32,9 +32,9 @@ discard block |
||
32 | 32 | * @param array|string $relations |
33 | 33 | * @return self |
34 | 34 | */ |
35 | - public function setRelations($relations) |
|
35 | + public function setRelations( $relations ) |
|
36 | 36 | { |
37 | - $this->setAvailableIncludes(array_merge($this->availableIncludes, (array) $relations)); |
|
37 | + $this->setAvailableIncludes( array_merge( $this->availableIncludes, (array) $relations ) ); |
|
38 | 38 | |
39 | 39 | return $this; |
40 | 40 | } |
@@ -49,13 +49,13 @@ discard block |
||
49 | 49 | * @return \League\Fractal\Resource\ResourceInterface|bool |
50 | 50 | * @throws \Exception |
51 | 51 | */ |
52 | - protected function callIncludeMethod(Scope $scope, $includeName, $data) |
|
52 | + protected function callIncludeMethod( Scope $scope, $includeName, $data ) |
|
53 | 53 | { |
54 | - if ($includeName === 'pivot') { |
|
55 | - return $this->includePivot($data->$includeName); |
|
54 | + if ( $includeName === 'pivot' ) { |
|
55 | + return $this->includePivot( $data->$includeName ); |
|
56 | 56 | } |
57 | 57 | |
58 | - return app(Responder::class)->transform($data->$includeName)->getResource(); |
|
58 | + return app( Responder::class )->transform( $data->$includeName )->getResource(); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
@@ -64,14 +64,14 @@ discard block |
||
64 | 64 | * @param Pivot $pivot |
65 | 65 | * @return \League\Fractal\Resource\ResourceInterface|bool |
66 | 66 | */ |
67 | - protected function includePivot(Pivot $pivot) |
|
67 | + protected function includePivot( Pivot $pivot ) |
|
68 | 68 | { |
69 | - if (! method_exists($this, 'transformPivot')) { |
|
69 | + if ( ! method_exists( $this, 'transformPivot' ) ) { |
|
70 | 70 | return false; |
71 | 71 | } |
72 | 72 | |
73 | - return app(Responder::class)->transform($pivot, function ($pivot) { |
|
74 | - return $this->transformPivot($pivot); |
|
73 | + return app( Responder::class )->transform( $pivot, function ( $pivot ) { |
|
74 | + return $this->transformPivot( $pivot ); |
|
75 | 75 | })->getResource(); |
76 | 76 | } |
77 | 77 | } |
78 | 78 | \ No newline at end of file |