@@ -156,8 +156,7 @@ discard block |
||
156 | 156 | if ($match[1] == '$this->validationRules') |
157 | 157 | { |
158 | 158 | $route['body'] = $validationRules; |
159 | - } |
|
160 | - else |
|
159 | + } else |
|
161 | 160 | { |
162 | 161 | $route['body'] = eval('return ' . $match[1] . ';'); |
163 | 162 | } |
@@ -167,14 +166,12 @@ discard block |
||
167 | 166 | if(strpos($rule, 'unique')) |
168 | 167 | { |
169 | 168 | $rule = substr($rule, 0, strpos($rule, 'unique') + 6); |
170 | - } |
|
171 | - elseif(strpos($rule, 'exists')) |
|
169 | + } elseif(strpos($rule, 'exists')) |
|
172 | 170 | { |
173 | 171 | $rule = substr($rule, 0, strpos($rule, 'exists') - 1); |
174 | 172 | } |
175 | 173 | } |
176 | - } |
|
177 | - else |
|
174 | + } else |
|
178 | 175 | { |
179 | 176 | $route['body'] = 'conditions'; |
180 | 177 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $this->getPostData($route, $reflectionMethod, $validationRules); |
63 | 63 | |
64 | 64 | preg_match('/api\/v1\/([^#]+)\//iU', $route['uri'], $module); |
65 | - $docData['modules'][$module[1]][substr($route['prefix'], strlen('/api/v1/' . $module[1] . '/') - 1)][] = $route; |
|
65 | + $docData['modules'][$module[1]][substr($route['prefix'], strlen('/api/v1/'.$module[1].'/') - 1)][] = $route; |
|
66 | 66 | |
67 | 67 | $this->getModels($classProperties['model'], $docData); |
68 | 68 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | protected function getRoutes() |
81 | 81 | { |
82 | - return collect(\Route::getRoutes())->map(function ($route) { |
|
82 | + return collect(\Route::getRoutes())->map(function($route) { |
|
83 | 83 | if (strpos($route->uri(), 'api/v') !== false) |
84 | 84 | { |
85 | 85 | return [ |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | ]; |
113 | 113 | |
114 | 114 | |
115 | - if (! $skipLoginCheck || ! in_array($method, $skipLoginCheck)) |
|
115 | + if ( ! $skipLoginCheck || ! in_array($method, $skipLoginCheck)) |
|
116 | 116 | { |
117 | 117 | $route['headers']['Authrization'] = 'bearer {token}'; |
118 | 118 | } |
@@ -165,16 +165,16 @@ discard block |
||
165 | 165 | } |
166 | 166 | else |
167 | 167 | { |
168 | - $route['body'] = eval('return ' . $match[1] . ';'); |
|
168 | + $route['body'] = eval('return '.$match[1].';'); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | foreach ($route['body'] as &$rule) |
172 | 172 | { |
173 | - if(strpos($rule, 'unique')) |
|
173 | + if (strpos($rule, 'unique')) |
|
174 | 174 | { |
175 | 175 | $rule = substr($rule, 0, strpos($rule, 'unique') + 6); |
176 | 176 | } |
177 | - elseif(strpos($rule, 'exists')) |
|
177 | + elseif (strpos($rule, 'exists')) |
|
178 | 178 | { |
179 | 179 | $rule = substr($rule, 0, strpos($rule, 'exists') - 1); |
180 | 180 | } |
@@ -247,10 +247,10 @@ discard block |
||
247 | 247 | $model = factory($modelClass)->make(); |
248 | 248 | $modelArr = $model->toArray(); |
249 | 249 | |
250 | - if ( $model->trans && ! $model->trans->count()) |
|
250 | + if ($model->trans && ! $model->trans->count()) |
|
251 | 251 | { |
252 | 252 | $modelArr['trans'] = [ |
253 | - 'en' => factory($modelClass . 'Translation')->make()->toArray() |
|
253 | + 'en' => factory($modelClass.'Translation')->make()->toArray() |
|
254 | 254 | ]; |
255 | 255 | } |
256 | 256 |
@@ -123,6 +123,7 @@ discard block |
||
123 | 123 | * |
124 | 124 | * @param array &$route |
125 | 125 | * @param object $reflectionMethod] |
126 | + * @param \ReflectionMethod $reflectionMethod |
|
126 | 127 | * @return void |
127 | 128 | */ |
128 | 129 | protected function processDocBlock(&$route, $reflectionMethod) |
@@ -145,7 +146,7 @@ discard block |
||
145 | 146 | * Generate post body for the given route. |
146 | 147 | * |
147 | 148 | * @param array &$route |
148 | - * @param object $reflectionMethod |
|
149 | + * @param \ReflectionMethod $reflectionMethod |
|
149 | 150 | * @param array $validationRules |
150 | 151 | * @return void |
151 | 152 | */ |
@@ -6,269 +6,269 @@ |
||
6 | 6 | |
7 | 7 | class GenerateDoc extends Command |
8 | 8 | { |
9 | - /** |
|
10 | - * The name and signature of the console command. |
|
11 | - * |
|
12 | - * @var string |
|
13 | - */ |
|
14 | - protected $signature = 'doc:generate'; |
|
9 | + /** |
|
10 | + * The name and signature of the console command. |
|
11 | + * |
|
12 | + * @var string |
|
13 | + */ |
|
14 | + protected $signature = 'doc:generate'; |
|
15 | 15 | |
16 | - /** |
|
17 | - * The console command description. |
|
18 | - * |
|
19 | - * @var string |
|
20 | - */ |
|
21 | - protected $description = 'Generate api documentation'; |
|
16 | + /** |
|
17 | + * The console command description. |
|
18 | + * |
|
19 | + * @var string |
|
20 | + */ |
|
21 | + protected $description = 'Generate api documentation'; |
|
22 | 22 | |
23 | - /** |
|
24 | - * Create a new command instance. |
|
25 | - * |
|
26 | - * @return void |
|
27 | - */ |
|
28 | - public function __construct() |
|
29 | - { |
|
30 | - parent::__construct(); |
|
31 | - } |
|
23 | + /** |
|
24 | + * Create a new command instance. |
|
25 | + * |
|
26 | + * @return void |
|
27 | + */ |
|
28 | + public function __construct() |
|
29 | + { |
|
30 | + parent::__construct(); |
|
31 | + } |
|
32 | 32 | |
33 | - /** |
|
34 | - * Execute the console command. |
|
35 | - * |
|
36 | - * @return mixed |
|
37 | - */ |
|
38 | - public function handle() |
|
39 | - { |
|
40 | - $docData = []; |
|
41 | - $docData['models'] = []; |
|
42 | - $routes = $this->getRoutes(); |
|
43 | - foreach ($routes as $route) |
|
44 | - { |
|
45 | - if ($route) |
|
46 | - { |
|
47 | - $actoinArray = explode('@', $route['action']); |
|
48 | - $controller = $actoinArray[0]; |
|
49 | - $method = $actoinArray[1]; |
|
50 | - $route['name'] = $method !== 'index' ? $method : 'list'; |
|
33 | + /** |
|
34 | + * Execute the console command. |
|
35 | + * |
|
36 | + * @return mixed |
|
37 | + */ |
|
38 | + public function handle() |
|
39 | + { |
|
40 | + $docData = []; |
|
41 | + $docData['models'] = []; |
|
42 | + $routes = $this->getRoutes(); |
|
43 | + foreach ($routes as $route) |
|
44 | + { |
|
45 | + if ($route) |
|
46 | + { |
|
47 | + $actoinArray = explode('@', $route['action']); |
|
48 | + $controller = $actoinArray[0]; |
|
49 | + $method = $actoinArray[1]; |
|
50 | + $route['name'] = $method !== 'index' ? $method : 'list'; |
|
51 | 51 | |
52 | - $reflectionClass = new \ReflectionClass($controller); |
|
53 | - $reflectionMethod = $reflectionClass->getMethod($method); |
|
54 | - $classProperties = $reflectionClass->getDefaultProperties(); |
|
55 | - $skipLoginCheck = array_key_exists('skipLoginCheck', $classProperties) ? $classProperties['skipLoginCheck'] : false; |
|
56 | - $validationRules = array_key_exists('validationRules', $classProperties) ? $classProperties['validationRules'] : false; |
|
52 | + $reflectionClass = new \ReflectionClass($controller); |
|
53 | + $reflectionMethod = $reflectionClass->getMethod($method); |
|
54 | + $classProperties = $reflectionClass->getDefaultProperties(); |
|
55 | + $skipLoginCheck = array_key_exists('skipLoginCheck', $classProperties) ? $classProperties['skipLoginCheck'] : false; |
|
56 | + $validationRules = array_key_exists('validationRules', $classProperties) ? $classProperties['validationRules'] : false; |
|
57 | 57 | |
58 | - $route['response'] = $this->getResponseObject($classProperties['model'], $route['name']); |
|
58 | + $route['response'] = $this->getResponseObject($classProperties['model'], $route['name']); |
|
59 | 59 | |
60 | - $this->processDocBlock($route, $reflectionMethod); |
|
61 | - $this->getHeaders($route, $method, $skipLoginCheck); |
|
62 | - $this->getPostData($route, $reflectionMethod, $validationRules); |
|
60 | + $this->processDocBlock($route, $reflectionMethod); |
|
61 | + $this->getHeaders($route, $method, $skipLoginCheck); |
|
62 | + $this->getPostData($route, $reflectionMethod, $validationRules); |
|
63 | 63 | |
64 | - preg_match('/api\/v1\/([^#]+)\//iU', $route['uri'], $module); |
|
65 | - $docData['modules'][$module[1]][substr($route['prefix'], strlen('/api/v1/' . $module[1] . '/') - 1)][] = $route; |
|
64 | + preg_match('/api\/v1\/([^#]+)\//iU', $route['uri'], $module); |
|
65 | + $docData['modules'][$module[1]][substr($route['prefix'], strlen('/api/v1/' . $module[1] . '/') - 1)][] = $route; |
|
66 | 66 | |
67 | - $this->getModels($classProperties['model'], $docData); |
|
68 | - } |
|
69 | - } |
|
67 | + $this->getModels($classProperties['model'], $docData); |
|
68 | + } |
|
69 | + } |
|
70 | 70 | |
71 | - $docData['errors'] = $this->getErrors(); |
|
72 | - \File::put(app_path('Modules/V1/Core/Resources/api.json'), json_encode($docData)); |
|
73 | - } |
|
71 | + $docData['errors'] = $this->getErrors(); |
|
72 | + \File::put(app_path('Modules/V1/Core/Resources/api.json'), json_encode($docData)); |
|
73 | + } |
|
74 | 74 | |
75 | - /** |
|
76 | - * Get list of all registered routes. |
|
77 | - * |
|
78 | - * @return collection |
|
79 | - */ |
|
80 | - protected function getRoutes() |
|
81 | - { |
|
82 | - return collect(\Route::getRoutes())->map(function ($route) { |
|
83 | - if (strpos($route->uri(), 'api/v') !== false) |
|
84 | - { |
|
85 | - return [ |
|
86 | - 'method' => $route->methods()[0], |
|
87 | - 'uri' => $route->uri(), |
|
88 | - 'action' => $route->getActionName(), |
|
89 | - 'prefix' => $route->getPrefix() |
|
90 | - ]; |
|
91 | - } |
|
92 | - return false; |
|
93 | - })->all(); |
|
94 | - } |
|
75 | + /** |
|
76 | + * Get list of all registered routes. |
|
77 | + * |
|
78 | + * @return collection |
|
79 | + */ |
|
80 | + protected function getRoutes() |
|
81 | + { |
|
82 | + return collect(\Route::getRoutes())->map(function ($route) { |
|
83 | + if (strpos($route->uri(), 'api/v') !== false) |
|
84 | + { |
|
85 | + return [ |
|
86 | + 'method' => $route->methods()[0], |
|
87 | + 'uri' => $route->uri(), |
|
88 | + 'action' => $route->getActionName(), |
|
89 | + 'prefix' => $route->getPrefix() |
|
90 | + ]; |
|
91 | + } |
|
92 | + return false; |
|
93 | + })->all(); |
|
94 | + } |
|
95 | 95 | |
96 | - /** |
|
97 | - * Generate headers for the given route. |
|
98 | - * |
|
99 | - * @param array &$route |
|
100 | - * @param string $method |
|
101 | - * @param array $skipLoginCheck |
|
102 | - * @return void |
|
103 | - */ |
|
104 | - protected function getHeaders(&$route, $method, $skipLoginCheck) |
|
105 | - { |
|
106 | - $route['headers'] = [ |
|
107 | - 'Accept' => 'application/json', |
|
108 | - 'Content-Type' => 'application/json', |
|
109 | - 'locale' => 'The language of the returned data: ar, en or all.', |
|
110 | - 'time-zone-diff' => 'Timezone difference between UTC and Local Time', |
|
111 | - ]; |
|
96 | + /** |
|
97 | + * Generate headers for the given route. |
|
98 | + * |
|
99 | + * @param array &$route |
|
100 | + * @param string $method |
|
101 | + * @param array $skipLoginCheck |
|
102 | + * @return void |
|
103 | + */ |
|
104 | + protected function getHeaders(&$route, $method, $skipLoginCheck) |
|
105 | + { |
|
106 | + $route['headers'] = [ |
|
107 | + 'Accept' => 'application/json', |
|
108 | + 'Content-Type' => 'application/json', |
|
109 | + 'locale' => 'The language of the returned data: ar, en or all.', |
|
110 | + 'time-zone-diff' => 'Timezone difference between UTC and Local Time', |
|
111 | + ]; |
|
112 | 112 | |
113 | 113 | |
114 | - if (! $skipLoginCheck || ! in_array($method, $skipLoginCheck)) |
|
115 | - { |
|
116 | - $route['headers']['Authrization'] = 'bearer {token}'; |
|
117 | - } |
|
118 | - } |
|
114 | + if (! $skipLoginCheck || ! in_array($method, $skipLoginCheck)) |
|
115 | + { |
|
116 | + $route['headers']['Authrization'] = 'bearer {token}'; |
|
117 | + } |
|
118 | + } |
|
119 | 119 | |
120 | - /** |
|
121 | - * Generate description and params for the given route |
|
122 | - * based on the docblock. |
|
123 | - * |
|
124 | - * @param array &$route |
|
125 | - * @param object $reflectionMethod] |
|
126 | - * @return void |
|
127 | - */ |
|
128 | - protected function processDocBlock(&$route, $reflectionMethod) |
|
129 | - { |
|
130 | - $factory = \phpDocumentor\Reflection\DocBlockFactory::createInstance(); |
|
131 | - $docblock = $factory->create($reflectionMethod->getDocComment()); |
|
132 | - $route['description'] = trim(preg_replace('/\s+/', ' ', $docblock->getSummary())); |
|
133 | - $params = $docblock->getTagsByName('param'); |
|
134 | - foreach ($params as $param) |
|
135 | - { |
|
136 | - $name = $param->getVariableName(); |
|
137 | - if ($name !== 'request') |
|
138 | - { |
|
139 | - $route['parametars'][$param->getVariableName()] = $param->getDescription()->render(); |
|
140 | - } |
|
141 | - } |
|
142 | - } |
|
120 | + /** |
|
121 | + * Generate description and params for the given route |
|
122 | + * based on the docblock. |
|
123 | + * |
|
124 | + * @param array &$route |
|
125 | + * @param object $reflectionMethod] |
|
126 | + * @return void |
|
127 | + */ |
|
128 | + protected function processDocBlock(&$route, $reflectionMethod) |
|
129 | + { |
|
130 | + $factory = \phpDocumentor\Reflection\DocBlockFactory::createInstance(); |
|
131 | + $docblock = $factory->create($reflectionMethod->getDocComment()); |
|
132 | + $route['description'] = trim(preg_replace('/\s+/', ' ', $docblock->getSummary())); |
|
133 | + $params = $docblock->getTagsByName('param'); |
|
134 | + foreach ($params as $param) |
|
135 | + { |
|
136 | + $name = $param->getVariableName(); |
|
137 | + if ($name !== 'request') |
|
138 | + { |
|
139 | + $route['parametars'][$param->getVariableName()] = $param->getDescription()->render(); |
|
140 | + } |
|
141 | + } |
|
142 | + } |
|
143 | 143 | |
144 | - /** |
|
145 | - * Generate post body for the given route. |
|
146 | - * |
|
147 | - * @param array &$route |
|
148 | - * @param object $reflectionMethod |
|
149 | - * @param array $validationRules |
|
150 | - * @return void |
|
151 | - */ |
|
152 | - protected function getPostData(&$route, $reflectionMethod, $validationRules) |
|
153 | - { |
|
154 | - if ($route['method'] == 'POST') |
|
155 | - { |
|
156 | - $body = $this->getMethodBody($reflectionMethod); |
|
144 | + /** |
|
145 | + * Generate post body for the given route. |
|
146 | + * |
|
147 | + * @param array &$route |
|
148 | + * @param object $reflectionMethod |
|
149 | + * @param array $validationRules |
|
150 | + * @return void |
|
151 | + */ |
|
152 | + protected function getPostData(&$route, $reflectionMethod, $validationRules) |
|
153 | + { |
|
154 | + if ($route['method'] == 'POST') |
|
155 | + { |
|
156 | + $body = $this->getMethodBody($reflectionMethod); |
|
157 | 157 | |
158 | - preg_match('/\$this->validate\(\$request,([^#]+)\);/iU', $body, $match); |
|
159 | - if (count($match)) |
|
160 | - { |
|
161 | - if ($match[1] == '$this->validationRules') |
|
162 | - { |
|
163 | - $route['body'] = $validationRules; |
|
164 | - } |
|
165 | - else |
|
166 | - { |
|
167 | - $route['body'] = eval('return ' . $match[1] . ';'); |
|
168 | - } |
|
158 | + preg_match('/\$this->validate\(\$request,([^#]+)\);/iU', $body, $match); |
|
159 | + if (count($match)) |
|
160 | + { |
|
161 | + if ($match[1] == '$this->validationRules') |
|
162 | + { |
|
163 | + $route['body'] = $validationRules; |
|
164 | + } |
|
165 | + else |
|
166 | + { |
|
167 | + $route['body'] = eval('return ' . $match[1] . ';'); |
|
168 | + } |
|
169 | 169 | |
170 | - foreach ($route['body'] as &$rule) |
|
171 | - { |
|
172 | - if(strpos($rule, 'unique')) |
|
173 | - { |
|
174 | - $rule = substr($rule, 0, strpos($rule, 'unique') + 6); |
|
175 | - } |
|
176 | - elseif(strpos($rule, 'exists')) |
|
177 | - { |
|
178 | - $rule = substr($rule, 0, strpos($rule, 'exists') - 1); |
|
179 | - } |
|
180 | - } |
|
181 | - } |
|
182 | - else |
|
183 | - { |
|
184 | - $route['body'] = 'conditions'; |
|
185 | - } |
|
186 | - } |
|
187 | - } |
|
170 | + foreach ($route['body'] as &$rule) |
|
171 | + { |
|
172 | + if(strpos($rule, 'unique')) |
|
173 | + { |
|
174 | + $rule = substr($rule, 0, strpos($rule, 'unique') + 6); |
|
175 | + } |
|
176 | + elseif(strpos($rule, 'exists')) |
|
177 | + { |
|
178 | + $rule = substr($rule, 0, strpos($rule, 'exists') - 1); |
|
179 | + } |
|
180 | + } |
|
181 | + } |
|
182 | + else |
|
183 | + { |
|
184 | + $route['body'] = 'conditions'; |
|
185 | + } |
|
186 | + } |
|
187 | + } |
|
188 | 188 | |
189 | - /** |
|
190 | - * Generate application errors. |
|
191 | - * |
|
192 | - * @return array |
|
193 | - */ |
|
194 | - protected function getErrors() |
|
195 | - { |
|
196 | - $errors = []; |
|
197 | - $reflectionClass = new \ReflectionClass('App\Modules\V1\Core\Utl\ErrorHandler'); |
|
198 | - foreach ($reflectionClass->getMethods() as $method) |
|
199 | - { |
|
200 | - $methodName = $method->getName(); |
|
201 | - $reflectionMethod = $reflectionClass->getMethod($methodName); |
|
202 | - $body = $this->getMethodBody($reflectionMethod); |
|
189 | + /** |
|
190 | + * Generate application errors. |
|
191 | + * |
|
192 | + * @return array |
|
193 | + */ |
|
194 | + protected function getErrors() |
|
195 | + { |
|
196 | + $errors = []; |
|
197 | + $reflectionClass = new \ReflectionClass('App\Modules\V1\Core\Utl\ErrorHandler'); |
|
198 | + foreach ($reflectionClass->getMethods() as $method) |
|
199 | + { |
|
200 | + $methodName = $method->getName(); |
|
201 | + $reflectionMethod = $reflectionClass->getMethod($methodName); |
|
202 | + $body = $this->getMethodBody($reflectionMethod); |
|
203 | 203 | |
204 | - preg_match('/\$error=\[\'status\'=>([^#]+)\,/iU', $body, $match); |
|
204 | + preg_match('/\$error=\[\'status\'=>([^#]+)\,/iU', $body, $match); |
|
205 | 205 | |
206 | - if (count($match)) |
|
207 | - { |
|
208 | - $errors[$match[1]][] = $methodName; |
|
209 | - } |
|
210 | - } |
|
206 | + if (count($match)) |
|
207 | + { |
|
208 | + $errors[$match[1]][] = $methodName; |
|
209 | + } |
|
210 | + } |
|
211 | 211 | |
212 | - return $errors; |
|
213 | - } |
|
212 | + return $errors; |
|
213 | + } |
|
214 | 214 | |
215 | - /** |
|
216 | - * Get the given method body code. |
|
217 | - * |
|
218 | - * @param object $reflectionMethod |
|
219 | - * @return string |
|
220 | - */ |
|
221 | - protected function getMethodBody($reflectionMethod) |
|
222 | - { |
|
223 | - $filename = $reflectionMethod->getFileName(); |
|
224 | - $start_line = $reflectionMethod->getStartLine() - 1; |
|
225 | - $end_line = $reflectionMethod->getEndLine(); |
|
226 | - $length = $end_line - $start_line; |
|
227 | - $source = file($filename); |
|
228 | - $body = implode("", array_slice($source, $start_line, $length)); |
|
229 | - $body = trim(preg_replace('/\s+/', '', $body)); |
|
215 | + /** |
|
216 | + * Get the given method body code. |
|
217 | + * |
|
218 | + * @param object $reflectionMethod |
|
219 | + * @return string |
|
220 | + */ |
|
221 | + protected function getMethodBody($reflectionMethod) |
|
222 | + { |
|
223 | + $filename = $reflectionMethod->getFileName(); |
|
224 | + $start_line = $reflectionMethod->getStartLine() - 1; |
|
225 | + $end_line = $reflectionMethod->getEndLine(); |
|
226 | + $length = $end_line - $start_line; |
|
227 | + $source = file($filename); |
|
228 | + $body = implode("", array_slice($source, $start_line, $length)); |
|
229 | + $body = trim(preg_replace('/\s+/', '', $body)); |
|
230 | 230 | |
231 | - return $body; |
|
232 | - } |
|
231 | + return $body; |
|
232 | + } |
|
233 | 233 | |
234 | - /** |
|
235 | - * Get example object of all availble models. |
|
236 | - * |
|
237 | - * @param string $modelName |
|
238 | - * @param array $docData |
|
239 | - * @return string |
|
240 | - */ |
|
241 | - protected function getModels($modelName, &$docData) |
|
242 | - { |
|
243 | - if ($modelName && ! array_key_exists($modelName, $docData['models'])) |
|
244 | - { |
|
245 | - $modelClass = call_user_func_array("\Core::{$modelName}", [])->modelClass; |
|
246 | - $model = factory($modelClass)->make(); |
|
247 | - $modelArr = $model->toArray(); |
|
234 | + /** |
|
235 | + * Get example object of all availble models. |
|
236 | + * |
|
237 | + * @param string $modelName |
|
238 | + * @param array $docData |
|
239 | + * @return string |
|
240 | + */ |
|
241 | + protected function getModels($modelName, &$docData) |
|
242 | + { |
|
243 | + if ($modelName && ! array_key_exists($modelName, $docData['models'])) |
|
244 | + { |
|
245 | + $modelClass = call_user_func_array("\Core::{$modelName}", [])->modelClass; |
|
246 | + $model = factory($modelClass)->make(); |
|
247 | + $modelArr = $model->toArray(); |
|
248 | 248 | |
249 | - if ( $model->trans && ! $model->trans->count()) |
|
250 | - { |
|
251 | - $modelArr['trans'] = [ |
|
252 | - 'en' => factory($modelClass . 'Translation')->make()->toArray() |
|
253 | - ]; |
|
254 | - } |
|
249 | + if ( $model->trans && ! $model->trans->count()) |
|
250 | + { |
|
251 | + $modelArr['trans'] = [ |
|
252 | + 'en' => factory($modelClass . 'Translation')->make()->toArray() |
|
253 | + ]; |
|
254 | + } |
|
255 | 255 | |
256 | - $docData['models'][$modelName] = json_encode($modelArr, JSON_PRETTY_PRINT); |
|
257 | - } |
|
258 | - } |
|
256 | + $docData['models'][$modelName] = json_encode($modelArr, JSON_PRETTY_PRINT); |
|
257 | + } |
|
258 | + } |
|
259 | 259 | |
260 | - /** |
|
261 | - * Get the route response object type. |
|
262 | - * |
|
263 | - * @param string $modelName |
|
264 | - * @param string $method |
|
265 | - * @return array |
|
266 | - */ |
|
267 | - protected function getResponseObject($modelName, $method) |
|
268 | - { |
|
269 | - $config = \CoreConfig::getConfig(); |
|
270 | - $relations = array_key_exists($modelName, $config['relations']) ? array_key_exists($method, $config['relations'][$modelName]) ? $config['relations'][$modelName] : false : false; |
|
260 | + /** |
|
261 | + * Get the route response object type. |
|
262 | + * |
|
263 | + * @param string $modelName |
|
264 | + * @param string $method |
|
265 | + * @return array |
|
266 | + */ |
|
267 | + protected function getResponseObject($modelName, $method) |
|
268 | + { |
|
269 | + $config = \CoreConfig::getConfig(); |
|
270 | + $relations = array_key_exists($modelName, $config['relations']) ? array_key_exists($method, $config['relations'][$modelName]) ? $config['relations'][$modelName] : false : false; |
|
271 | 271 | |
272 | - return $relations ? [$modelName => $relations && $relations[$method] ? $relations[$method] : []] : false; |
|
273 | - } |
|
272 | + return $relations ? [$modelName => $relations && $relations[$method] ? $relations[$method] : []] : false; |
|
273 | + } |
|
274 | 274 | } |
@@ -7,50 +7,50 @@ |
||
7 | 7 | class ModuleServiceProvider extends ServiceProvider |
8 | 8 | { |
9 | 9 | /** |
10 | - * Bootstrap the module services. |
|
11 | - * |
|
12 | - * @return void |
|
13 | - */ |
|
14 | - public function boot() |
|
15 | - { |
|
16 | - $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'core'); |
|
17 | - $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'core'); |
|
18 | - |
|
19 | - $factory = app('Illuminate\Database\Eloquent\Factory'); |
|
20 | - $factory->load(__DIR__.'/../Database/Factories'); |
|
21 | - } |
|
22 | - |
|
23 | - /** |
|
24 | - * Register the module services. |
|
25 | - * |
|
26 | - * @return void |
|
27 | - */ |
|
28 | - public function register() |
|
29 | - { |
|
30 | - //Bind Core Facade to the IoC Container |
|
31 | - \App::bind('Core', function() |
|
32 | - { |
|
33 | - return new \App\Modules\V1\Core\Core; |
|
34 | - }); |
|
35 | - |
|
36 | - //Bind ErrorHandler Facade to the IoC Container |
|
37 | - \App::bind('ErrorHandler', function() |
|
38 | - { |
|
39 | - return new \App\Modules\V1\Core\Utl\ErrorHandler; |
|
40 | - }); |
|
41 | - |
|
42 | - //Bind CoreConfig Facade to the IoC Container |
|
43 | - \App::bind('CoreConfig', function() |
|
44 | - { |
|
45 | - return new \App\Modules\V1\Core\Utl\CoreConfig; |
|
46 | - }); |
|
47 | - |
|
48 | - //Bind Logging Facade to the IoC Container |
|
49 | - \App::bind('Logging', function() |
|
50 | - { |
|
51 | - return new \App\Modules\V1\Core\Utl\Logging; |
|
52 | - }); |
|
10 | + * Bootstrap the module services. |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function boot() |
|
15 | + { |
|
16 | + $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'core'); |
|
17 | + $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'core'); |
|
18 | + |
|
19 | + $factory = app('Illuminate\Database\Eloquent\Factory'); |
|
20 | + $factory->load(__DIR__.'/../Database/Factories'); |
|
21 | + } |
|
22 | + |
|
23 | + /** |
|
24 | + * Register the module services. |
|
25 | + * |
|
26 | + * @return void |
|
27 | + */ |
|
28 | + public function register() |
|
29 | + { |
|
30 | + //Bind Core Facade to the IoC Container |
|
31 | + \App::bind('Core', function() |
|
32 | + { |
|
33 | + return new \App\Modules\V1\Core\Core; |
|
34 | + }); |
|
35 | + |
|
36 | + //Bind ErrorHandler Facade to the IoC Container |
|
37 | + \App::bind('ErrorHandler', function() |
|
38 | + { |
|
39 | + return new \App\Modules\V1\Core\Utl\ErrorHandler; |
|
40 | + }); |
|
41 | + |
|
42 | + //Bind CoreConfig Facade to the IoC Container |
|
43 | + \App::bind('CoreConfig', function() |
|
44 | + { |
|
45 | + return new \App\Modules\V1\Core\Utl\CoreConfig; |
|
46 | + }); |
|
47 | + |
|
48 | + //Bind Logging Facade to the IoC Container |
|
49 | + \App::bind('Logging', function() |
|
50 | + { |
|
51 | + return new \App\Modules\V1\Core\Utl\Logging; |
|
52 | + }); |
|
53 | 53 | |
54 | - $this->app->register(RouteServiceProvider::class); |
|
55 | - } |
|
54 | + $this->app->register(RouteServiceProvider::class); |
|
55 | + } |
|
56 | 56 | } |
@@ -7,26 +7,26 @@ |
||
7 | 7 | class ModuleServiceProvider extends ServiceProvider |
8 | 8 | { |
9 | 9 | /** |
10 | - * Bootstrap the module services. |
|
11 | - * |
|
12 | - * @return void |
|
13 | - */ |
|
14 | - public function boot() |
|
15 | - { |
|
16 | - $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'reporting'); |
|
17 | - $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'reporting'); |
|
10 | + * Bootstrap the module services. |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function boot() |
|
15 | + { |
|
16 | + $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'reporting'); |
|
17 | + $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'reporting'); |
|
18 | 18 | |
19 | - $factory = app('Illuminate\Database\Eloquent\Factory'); |
|
20 | - $factory->load(__DIR__.'/../Database/Factories'); |
|
21 | - } |
|
19 | + $factory = app('Illuminate\Database\Eloquent\Factory'); |
|
20 | + $factory->load(__DIR__.'/../Database/Factories'); |
|
21 | + } |
|
22 | 22 | |
23 | - /** |
|
24 | - * Register the module services. |
|
25 | - * |
|
26 | - * @return void |
|
27 | - */ |
|
28 | - public function register() |
|
29 | - { |
|
30 | - $this->app->register(RouteServiceProvider::class); |
|
31 | - } |
|
23 | + /** |
|
24 | + * Register the module services. |
|
25 | + * |
|
26 | + * @return void |
|
27 | + */ |
|
28 | + public function register() |
|
29 | + { |
|
30 | + $this->app->register(RouteServiceProvider::class); |
|
31 | + } |
|
32 | 32 | } |
@@ -7,26 +7,26 @@ |
||
7 | 7 | class ModuleServiceProvider extends ServiceProvider |
8 | 8 | { |
9 | 9 | /** |
10 | - * Bootstrap the module services. |
|
11 | - * |
|
12 | - * @return void |
|
13 | - */ |
|
14 | - public function boot() |
|
15 | - { |
|
16 | - $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'notification'); |
|
17 | - $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'notification'); |
|
10 | + * Bootstrap the module services. |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function boot() |
|
15 | + { |
|
16 | + $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'notification'); |
|
17 | + $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'notification'); |
|
18 | 18 | |
19 | - $factory = app('Illuminate\Database\Eloquent\Factory'); |
|
20 | - $factory->load(__DIR__.'/../Database/Factories'); |
|
21 | - } |
|
19 | + $factory = app('Illuminate\Database\Eloquent\Factory'); |
|
20 | + $factory->load(__DIR__.'/../Database/Factories'); |
|
21 | + } |
|
22 | 22 | |
23 | - /** |
|
24 | - * Register the module services. |
|
25 | - * |
|
26 | - * @return void |
|
27 | - */ |
|
28 | - public function register() |
|
29 | - { |
|
30 | - $this->app->register(RouteServiceProvider::class); |
|
31 | - } |
|
23 | + /** |
|
24 | + * Register the module services. |
|
25 | + * |
|
26 | + * @return void |
|
27 | + */ |
|
28 | + public function register() |
|
29 | + { |
|
30 | + $this->app->register(RouteServiceProvider::class); |
|
31 | + } |
|
32 | 32 | } |
@@ -6,27 +6,27 @@ |
||
6 | 6 | |
7 | 7 | class ModuleServiceProvider extends ServiceProvider |
8 | 8 | { |
9 | - /** |
|
10 | - * Bootstrap the module services. |
|
11 | - * |
|
12 | - * @return void |
|
13 | - */ |
|
14 | - public function boot() |
|
15 | - { |
|
16 | - $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'acl'); |
|
17 | - $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'acl'); |
|
9 | + /** |
|
10 | + * Bootstrap the module services. |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function boot() |
|
15 | + { |
|
16 | + $this->loadTranslationsFrom(__DIR__.'/../Resources/Lang', 'acl'); |
|
17 | + $this->loadViewsFrom(__DIR__.'/../Resources/Views', 'acl'); |
|
18 | 18 | |
19 | - $factory = app('Illuminate\Database\Eloquent\Factory'); |
|
20 | - $factory->load(__DIR__.'/../Database/Factories'); |
|
21 | - } |
|
19 | + $factory = app('Illuminate\Database\Eloquent\Factory'); |
|
20 | + $factory->load(__DIR__.'/../Database/Factories'); |
|
21 | + } |
|
22 | 22 | |
23 | - /** |
|
24 | - * Register the module services. |
|
25 | - * |
|
26 | - * @return void |
|
27 | - */ |
|
28 | - public function register() |
|
29 | - { |
|
30 | - $this->app->register(RouteServiceProvider::class); |
|
31 | - } |
|
23 | + /** |
|
24 | + * Register the module services. |
|
25 | + * |
|
26 | + * @return void |
|
27 | + */ |
|
28 | + public function register() |
|
29 | + { |
|
30 | + $this->app->register(RouteServiceProvider::class); |
|
31 | + } |
|
32 | 32 | } |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | { |
9 | 9 | public function index() |
10 | 10 | { |
11 | - $path = str_replace($_SERVER['DOCUMENT_ROOT'], '',str_replace('\\', '/', __FILE__)); |
|
11 | + $path = str_replace($_SERVER['DOCUMENT_ROOT'], '', str_replace('\\', '/', __FILE__)); |
|
12 | 12 | $baseUrl = str_replace('Http/Controllers/ApiDocumentController.php', '', $path); |
13 | 13 | $jsonDoc = json_decode(file_get_contents(app_path('Modules/V1/Core/Resources/api.json')), true); |
14 | 14 | $modules = $jsonDoc['modules']; |
@@ -21,27 +21,27 @@ discard block |
||
21 | 21 | ], |
22 | 22 | [ |
23 | 23 | 'title' => 'email equal [email protected] and user is blocked:', |
24 | - 'content' => ['and' => ['email' => '[email protected]','blocked' => 1]] |
|
24 | + 'content' => ['and' => ['email' => '[email protected]', 'blocked' => 1]] |
|
25 | 25 | ], |
26 | 26 | [ |
27 | 27 | 'title' => 'email equal [email protected] or user is blocked:', |
28 | - 'content' => ['or' => ['email' => '[email protected]','blocked' => 1]] |
|
28 | + 'content' => ['or' => ['email' => '[email protected]', 'blocked' => 1]] |
|
29 | 29 | ], |
30 | 30 | [ |
31 | 31 | 'title' => 'email contain John:', |
32 | - 'content' => ['email' => ['op' => 'like','val' => '%John%']] |
|
32 | + 'content' => ['email' => ['op' => 'like', 'val' => '%John%']] |
|
33 | 33 | ], |
34 | 34 | [ |
35 | 35 | 'title' => 'user created after 2016-10-25:', |
36 | - 'content' => ['created_at' => ['op' => '>','val' => '2016-10-25']] |
|
36 | + 'content' => ['created_at' => ['op' => '>', 'val' => '2016-10-25']] |
|
37 | 37 | ], |
38 | 38 | [ |
39 | 39 | 'title' => 'user created between 2016-10-20 and 2016-10-25:', |
40 | - 'content' => ['created_at' => ['op' => 'between','val1' => '2016-10-20','val2' => '2016-10-25']] |
|
40 | + 'content' => ['created_at' => ['op' => 'between', 'val1' => '2016-10-20', 'val2' => '2016-10-25']] |
|
41 | 41 | ], |
42 | 42 | [ |
43 | 43 | 'title' => 'user id in 1,2,3:', |
44 | - 'content' => ['id' => ['op' => 'in','val' => [1, 2, 3]]] |
|
44 | + 'content' => ['id' => ['op' => 'in', 'val' => [1, 2, 3]]] |
|
45 | 45 | ], |
46 | 46 | [ |
47 | 47 | 'title' => 'user name is null:', |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | ], |
54 | 54 | [ |
55 | 55 | 'title' => 'user has group admin:', |
56 | - 'content' => ['groups' => ['op' => 'has','val' => ['name' => 'Admin']]] |
|
56 | + 'content' => ['groups' => ['op' => 'has', 'val' => ['name' => 'Admin']]] |
|
57 | 57 | ] |
58 | 58 | ]; |
59 | 59 |
@@ -2,7 +2,6 @@ |
||
2 | 2 | namespace App\Modules\V1\Core\Http\Controllers; |
3 | 3 | |
4 | 4 | use App\Http\Controllers\Controller; |
5 | -use Illuminate\Http\Request; |
|
6 | 5 | |
7 | 6 | class ApiDocumentController extends Controller |
8 | 7 | { |
@@ -6,15 +6,15 @@ |
||
6 | 6 | |
7 | 7 | class ClearDataSeeder extends Seeder |
8 | 8 | { |
9 | - /** |
|
10 | - * Run the database seeds. |
|
11 | - * |
|
12 | - * @return void |
|
13 | - */ |
|
14 | - public function run() |
|
15 | - { |
|
16 | - $permissions = \DB::table('permissions')->whereIn('model', ['notifications', 'pushNotificationDevices']); |
|
17 | - \DB::table('groups_permissions')->whereIn('permission_id', $permissions->pluck('id'))->delete(); |
|
18 | - $permissions->delete(); |
|
19 | - } |
|
9 | + /** |
|
10 | + * Run the database seeds. |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function run() |
|
15 | + { |
|
16 | + $permissions = \DB::table('permissions')->whereIn('model', ['notifications', 'pushNotificationDevices']); |
|
17 | + \DB::table('groups_permissions')->whereIn('permission_id', $permissions->pluck('id'))->delete(); |
|
18 | + $permissions->delete(); |
|
19 | + } |
|
20 | 20 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function run() |
15 | 15 | { |
16 | - $permissions = \DB::table('permissions')->whereIn('model', ['notifications', 'pushNotificationDevices']); |
|
16 | + $permissions = \DB::table('permissions')->whereIn('model', ['notifications', 'pushNotificationDevices']); |
|
17 | 17 | \DB::table('groups_permissions')->whereIn('permission_id', $permissions->pluck('id'))->delete(); |
18 | 18 | $permissions->delete(); |
19 | 19 | } |
@@ -6,88 +6,88 @@ |
||
6 | 6 | |
7 | 7 | class PushNotificationsDevicesTableSeeder extends Seeder |
8 | 8 | { |
9 | - /** |
|
10 | - * Run the database seeds. |
|
11 | - * |
|
12 | - * @return void |
|
13 | - */ |
|
14 | - public function run() |
|
15 | - { |
|
16 | - /** |
|
17 | - * Insert the permissions related to settings table. |
|
18 | - */ |
|
19 | - \DB::table('permissions')->insert( |
|
20 | - [ |
|
21 | - /** |
|
22 | - * pushNotificationDevices model permissions. |
|
23 | - */ |
|
24 | - [ |
|
25 | - 'name' => 'find', |
|
26 | - 'model' => 'pushNotificationDevices', |
|
27 | - 'created_at' => \DB::raw('NOW()'), |
|
28 | - 'updated_at' => \DB::raw('NOW()') |
|
29 | - ], |
|
30 | - [ |
|
31 | - 'name' => 'search', |
|
32 | - 'model' => 'pushNotificationDevices', |
|
33 | - 'created_at' => \DB::raw('NOW()'), |
|
34 | - 'updated_at' => \DB::raw('NOW()') |
|
35 | - ], |
|
36 | - [ |
|
37 | - 'name' => 'list', |
|
38 | - 'model' => 'pushNotificationDevices', |
|
39 | - 'created_at' => \DB::raw('NOW()'), |
|
40 | - 'updated_at' => \DB::raw('NOW()') |
|
41 | - ], |
|
42 | - [ |
|
43 | - 'name' => 'findby', |
|
44 | - 'model' => 'pushNotificationDevices', |
|
45 | - 'created_at' => \DB::raw('NOW()'), |
|
46 | - 'updated_at' => \DB::raw('NOW()') |
|
47 | - ], |
|
48 | - [ |
|
49 | - 'name' => 'first', |
|
50 | - 'model' => 'pushNotificationDevices', |
|
51 | - 'created_at' => \DB::raw('NOW()'), |
|
52 | - 'updated_at' => \DB::raw('NOW()') |
|
53 | - ], |
|
54 | - [ |
|
55 | - 'name' => 'paginate', |
|
56 | - 'model' => 'pushNotificationDevices', |
|
57 | - 'created_at' => \DB::raw('NOW()'), |
|
58 | - 'updated_at' => \DB::raw('NOW()') |
|
59 | - ], |
|
60 | - [ |
|
61 | - 'name' => 'paginateby', |
|
62 | - 'model' => 'pushNotificationDevices', |
|
63 | - 'created_at' => \DB::raw('NOW()'), |
|
64 | - 'updated_at' => \DB::raw('NOW()') |
|
65 | - ], |
|
66 | - [ |
|
67 | - 'name' => 'save', |
|
68 | - 'model' => 'pushNotificationDevices', |
|
69 | - 'created_at' => \DB::raw('NOW()'), |
|
70 | - 'updated_at' => \DB::raw('NOW()') |
|
71 | - ], |
|
72 | - [ |
|
73 | - 'name' => 'delete', |
|
74 | - 'model' => 'pushNotificationDevices', |
|
75 | - 'created_at' => \DB::raw('NOW()'), |
|
76 | - 'updated_at' => \DB::raw('NOW()') |
|
77 | - ], |
|
78 | - [ |
|
79 | - 'name' => 'deleted', |
|
80 | - 'model' => 'pushNotificationDevices', |
|
81 | - 'created_at' => \DB::raw('NOW()'), |
|
82 | - 'updated_at' => \DB::raw('NOW()') |
|
83 | - ], |
|
84 | - [ |
|
85 | - 'name' => 'restore', |
|
86 | - 'model' => 'pushNotificationDevices', |
|
87 | - 'created_at' => \DB::raw('NOW()'), |
|
88 | - 'updated_at' => \DB::raw('NOW()') |
|
89 | - ] |
|
90 | - ] |
|
91 | - ); |
|
92 | - } |
|
9 | + /** |
|
10 | + * Run the database seeds. |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function run() |
|
15 | + { |
|
16 | + /** |
|
17 | + * Insert the permissions related to settings table. |
|
18 | + */ |
|
19 | + \DB::table('permissions')->insert( |
|
20 | + [ |
|
21 | + /** |
|
22 | + * pushNotificationDevices model permissions. |
|
23 | + */ |
|
24 | + [ |
|
25 | + 'name' => 'find', |
|
26 | + 'model' => 'pushNotificationDevices', |
|
27 | + 'created_at' => \DB::raw('NOW()'), |
|
28 | + 'updated_at' => \DB::raw('NOW()') |
|
29 | + ], |
|
30 | + [ |
|
31 | + 'name' => 'search', |
|
32 | + 'model' => 'pushNotificationDevices', |
|
33 | + 'created_at' => \DB::raw('NOW()'), |
|
34 | + 'updated_at' => \DB::raw('NOW()') |
|
35 | + ], |
|
36 | + [ |
|
37 | + 'name' => 'list', |
|
38 | + 'model' => 'pushNotificationDevices', |
|
39 | + 'created_at' => \DB::raw('NOW()'), |
|
40 | + 'updated_at' => \DB::raw('NOW()') |
|
41 | + ], |
|
42 | + [ |
|
43 | + 'name' => 'findby', |
|
44 | + 'model' => 'pushNotificationDevices', |
|
45 | + 'created_at' => \DB::raw('NOW()'), |
|
46 | + 'updated_at' => \DB::raw('NOW()') |
|
47 | + ], |
|
48 | + [ |
|
49 | + 'name' => 'first', |
|
50 | + 'model' => 'pushNotificationDevices', |
|
51 | + 'created_at' => \DB::raw('NOW()'), |
|
52 | + 'updated_at' => \DB::raw('NOW()') |
|
53 | + ], |
|
54 | + [ |
|
55 | + 'name' => 'paginate', |
|
56 | + 'model' => 'pushNotificationDevices', |
|
57 | + 'created_at' => \DB::raw('NOW()'), |
|
58 | + 'updated_at' => \DB::raw('NOW()') |
|
59 | + ], |
|
60 | + [ |
|
61 | + 'name' => 'paginateby', |
|
62 | + 'model' => 'pushNotificationDevices', |
|
63 | + 'created_at' => \DB::raw('NOW()'), |
|
64 | + 'updated_at' => \DB::raw('NOW()') |
|
65 | + ], |
|
66 | + [ |
|
67 | + 'name' => 'save', |
|
68 | + 'model' => 'pushNotificationDevices', |
|
69 | + 'created_at' => \DB::raw('NOW()'), |
|
70 | + 'updated_at' => \DB::raw('NOW()') |
|
71 | + ], |
|
72 | + [ |
|
73 | + 'name' => 'delete', |
|
74 | + 'model' => 'pushNotificationDevices', |
|
75 | + 'created_at' => \DB::raw('NOW()'), |
|
76 | + 'updated_at' => \DB::raw('NOW()') |
|
77 | + ], |
|
78 | + [ |
|
79 | + 'name' => 'deleted', |
|
80 | + 'model' => 'pushNotificationDevices', |
|
81 | + 'created_at' => \DB::raw('NOW()'), |
|
82 | + 'updated_at' => \DB::raw('NOW()') |
|
83 | + ], |
|
84 | + [ |
|
85 | + 'name' => 'restore', |
|
86 | + 'model' => 'pushNotificationDevices', |
|
87 | + 'created_at' => \DB::raw('NOW()'), |
|
88 | + 'updated_at' => \DB::raw('NOW()') |
|
89 | + ] |
|
90 | + ] |
|
91 | + ); |
|
92 | + } |
|
93 | 93 | } |
@@ -6,16 +6,16 @@ |
||
6 | 6 | |
7 | 7 | class NotificationsDatabaseSeeder extends Seeder |
8 | 8 | { |
9 | - /** |
|
10 | - * Run the database seeds. |
|
11 | - * |
|
12 | - * @return void |
|
13 | - */ |
|
14 | - public function run() |
|
15 | - { |
|
16 | - $this->call(ClearDataSeeder::class); |
|
17 | - $this->call(NotificationsTableSeeder::class); |
|
18 | - $this->call(PushNotificationsDevicesTableSeeder::class); |
|
19 | - $this->call(AssignRelationsSeeder::class); |
|
20 | - } |
|
9 | + /** |
|
10 | + * Run the database seeds. |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function run() |
|
15 | + { |
|
16 | + $this->call(ClearDataSeeder::class); |
|
17 | + $this->call(NotificationsTableSeeder::class); |
|
18 | + $this->call(PushNotificationsDevicesTableSeeder::class); |
|
19 | + $this->call(AssignRelationsSeeder::class); |
|
20 | + } |
|
21 | 21 | } |