@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | return ''; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - return $this->successResponse($message ?? $this->getModelClassName().' deleted successfully', [], 204); |
|
| 46 | + return $this->successResponse($message ?? $this->getModelClassName() . ' deleted successfully', [], 204); |
|
| 47 | 47 | } catch (\Exception $e) { |
| 48 | 48 | abort(500, $e->getMessage()); |
| 49 | 49 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | return $this->getServiceVariable()->refresh(); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - return $this->successResponse($message ?? $this->getModelClassName().' updated successfully'); |
|
| 70 | + return $this->successResponse($message ?? $this->getModelClassName() . ' updated successfully'); |
|
| 71 | 71 | } catch (\Exception $e) { |
| 72 | 72 | abort(500, $e->getMessage()); |
| 73 | 73 | } |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | return $model; |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - return $this->successResponse($message ?? $this->getModelClassName().' created successfully', [], 201); |
|
| 94 | + return $this->successResponse($message ?? $this->getModelClassName() . ' created successfully', [], 201); |
|
| 95 | 95 | } catch (\Exception $e) { |
| 96 | 96 | abort(500, $e->getMessage()); |
| 97 | 97 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | return $model; |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | - return $this->successResponse($message ?? $this->getModelClassName().' created successfully', [], 201); |
|
| 120 | + return $this->successResponse($message ?? $this->getModelClassName() . ' created successfully', [], 201); |
|
| 121 | 121 | } catch (\Exception $e) { |
| 122 | 122 | abort(500, $e->getMessage()); |
| 123 | 123 | } |
@@ -180,9 +180,9 @@ discard block |
||
| 180 | 180 | private function getServiceVariable() |
| 181 | 181 | { |
| 182 | 182 | return collect(get_object_vars($this)) |
| 183 | - ->reject(fn ($var) => ! ($var instanceof Model)) |
|
| 184 | - ->filter(function ($var, $key) { |
|
| 185 | - return Str::contains('get'.Str::ucfirst($key), get_class_methods($this)) |
|
| 183 | + ->reject(fn($var) => !($var instanceof Model)) |
|
| 184 | + ->filter(function($var, $key) { |
|
| 185 | + return Str::contains('get' . Str::ucfirst($key), get_class_methods($this)) |
|
| 186 | 186 | && Str::startsWith(Str::lower(class_basename($this)), $key); |
| 187 | 187 | })->first(); |
| 188 | 188 | } |