@@ -31,14 +31,14 @@ |
||
31 | 31 | 'App\Providers\AdminSectionsServiceProvider' |
32 | 32 | ); |
33 | 33 | |
34 | - if (! $provider) { |
|
34 | + if (!$provider) { |
|
35 | 35 | $this->error('[App\Providers\AdminSectionsServiceProvider] not found'); |
36 | 36 | |
37 | 37 | return; |
38 | 38 | } |
39 | 39 | |
40 | 40 | foreach ($provider->sections() as $model => $section) { |
41 | - $this->callSilent('sleepingowl:section:make', ['name' => $section, 'model' => $model]); |
|
41 | + $this->callSilent('sleepingowl:section:make', [ 'name' => $section, 'model' => $model ]); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | $this->info('Sections generated successfully!'); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | $title = $this->option('title'); |
39 | 39 | |
40 | - $this->call('vendor:publish', ['--provider' => SleepingOwlServiceProvider::class]); |
|
40 | + $this->call('vendor:publish', [ '--provider' => SleepingOwlServiceProvider::class ]); |
|
41 | 41 | |
42 | 42 | $this->publishConfig($title); |
43 | 43 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | { |
57 | 57 | $directory = config('sleeping_owl.bootstrapDirectory'); |
58 | 58 | |
59 | - if (! is_dir($directory)) { |
|
59 | + if (!is_dir($directory)) { |
|
60 | 60 | $this->files->makeDirectory($directory, 0755, true, true); |
61 | 61 | $this->line('<info>Admin bootstrap directory was created:</info> '.str_replace(base_path(), '', $directory)); |
62 | 62 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | { |
70 | 70 | $file = config('sleeping_owl.bootstrapDirectory').'/navigation.php'; |
71 | 71 | |
72 | - if (! file_exists($file)) { |
|
72 | + if (!file_exists($file)) { |
|
73 | 73 | $contents = $this->files->get(__DIR__.'/stubs/navigation.stub'); |
74 | 74 | $this->files->put($file, $contents); |
75 | 75 | $this->line('<info>Menu file was created:</info> '.str_replace(base_path(), '', $file)); |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | protected function createBootstrapFile() |
83 | 83 | { |
84 | 84 | $file = config('sleeping_owl.bootstrapDirectory').'/bootstrap.php'; |
85 | - if (! file_exists($file)) { |
|
85 | + if (!file_exists($file)) { |
|
86 | 86 | $contents = $this->files->get(__DIR__.'/stubs/bootstrap.stub'); |
87 | 87 | $this->files->put($file, $contents); |
88 | 88 | $this->line('<info>Bootstrap file was created:</info> '.str_replace(base_path(), '', $file)); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | protected function createRoutesFile() |
101 | 101 | { |
102 | 102 | $file = config('sleeping_owl.bootstrapDirectory').'/routes.php'; |
103 | - if (! file_exists($file)) { |
|
103 | + if (!file_exists($file)) { |
|
104 | 104 | $contents = $this->files->get(__DIR__.'/stubs/routes.stub'); |
105 | 105 | $this->files->put($file, $contents); |
106 | 106 | $this->line('<info>Bootstrap file was created:</info> '.str_replace(base_path(), '', $file)); |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | protected function createPublicDefaultStructure() |
114 | 114 | { |
115 | 115 | $uploadsDirectory = public_path('images/uploads'); |
116 | - if (! is_dir($uploadsDirectory)) { |
|
116 | + if (!is_dir($uploadsDirectory)) { |
|
117 | 117 | $this->files->makeDirectory($uploadsDirectory, 0755, true, true); |
118 | 118 | } |
119 | 119 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | { |
128 | 128 | $file = config_path('sleeping_owl.php'); |
129 | 129 | |
130 | - if (! is_null($title)) { |
|
130 | + if (!is_null($title)) { |
|
131 | 131 | $contents = $this->files->get($file); |
132 | 132 | $contents = str_replace('Sleeping Owl administrator', $title, $contents); |
133 | 133 | $this->files->put($file, $contents); |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | protected function getOptions() |
142 | 142 | { |
143 | 143 | return [ |
144 | - ['title', null, InputOption::VALUE_REQUIRED, 'Title for admin module.'], |
|
144 | + [ 'title', null, InputOption::VALUE_REQUIRED, 'Title for admin module.' ], |
|
145 | 145 | ]; |
146 | 146 | } |
147 | 147 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | $file = app_path('Providers/AdminSectionsServiceProvider.php'); |
32 | 32 | $ns = rtrim($this->getLaravel()->getNamespace(), '\\'); |
33 | 33 | |
34 | - if (! file_exists($file)) { |
|
34 | + if (!file_exists($file)) { |
|
35 | 35 | $contents = str_replace( |
36 | 36 | '__NAMESPACE__', |
37 | 37 | $ns, |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * @param WysiwygFilterInterface|null $filter |
46 | 46 | * @param array $config |
47 | 47 | */ |
48 | - public function __construct($id, $name = null, WysiwygFilterInterface $filter = null, array $config = []) |
|
48 | + public function __construct($id, $name = null, WysiwygFilterInterface $filter = null, array $config = [ ]) |
|
49 | 49 | { |
50 | 50 | $this->id = $id; |
51 | 51 | $this->name = is_null($name) ? studly_case($id) : $name; |
@@ -140,8 +140,8 @@ discard block |
||
140 | 140 | |
141 | 141 | public function __call($method, $arguments) |
142 | 142 | { |
143 | - if (in_array($method, ['js', 'css'])) { |
|
144 | - call_user_func_array([$this->getPackage(), $method], $arguments); |
|
143 | + if (in_array($method, [ 'js', 'css' ])) { |
|
144 | + call_user_func_array([ $this->getPackage(), $method ], $arguments); |
|
145 | 145 | |
146 | 146 | return $this; |
147 | 147 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | |
22 | 22 | public function register() |
23 | 23 | { |
24 | - $this->app->singleton('sleeping_owl', function () { |
|
24 | + $this->app->singleton('sleeping_owl', function() { |
|
25 | 25 | return new Admin(); |
26 | 26 | }); |
27 | 27 | |
@@ -31,13 +31,13 @@ discard block |
||
31 | 31 | $this->registerWysiwyg(); |
32 | 32 | $this->registerAliases(); |
33 | 33 | |
34 | - $this->app->booted(function () { |
|
34 | + $this->app->booted(function() { |
|
35 | 35 | $this->registerCustomRoutes(); |
36 | 36 | $this->registerDefaultRoutes(); |
37 | 37 | $this->registerNavigationFile(); |
38 | 38 | }); |
39 | 39 | |
40 | - ModelConfigurationManager::setEventDispatcher($this->app['events']); |
|
40 | + ModelConfigurationManager::setEventDispatcher($this->app[ 'events' ]); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | */ |
48 | 48 | protected function getConfig($key) |
49 | 49 | { |
50 | - return $this->app['config']->get('sleeping_owl.'.$key); |
|
50 | + return $this->app[ 'config' ]->get('sleeping_owl.'.$key); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | /** |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | protected function getBootstrapPath($path = null) |
59 | 59 | { |
60 | - if (! is_null($path)) { |
|
60 | + if (!is_null($path)) { |
|
61 | 61 | $path = DIRECTORY_SEPARATOR.$path; |
62 | 62 | } |
63 | 63 | |
@@ -66,14 +66,14 @@ discard block |
||
66 | 66 | |
67 | 67 | public function boot() |
68 | 68 | { |
69 | - $this->app->singleton('sleeping_owl.template', function () { |
|
70 | - return $this->app['sleeping_owl']->template(); |
|
69 | + $this->app->singleton('sleeping_owl.template', function() { |
|
70 | + return $this->app[ 'sleeping_owl' ]->template(); |
|
71 | 71 | }); |
72 | 72 | |
73 | 73 | $this->registerBootstrap(); |
74 | 74 | |
75 | - $this->registerRoutes(function (Router $route) { |
|
76 | - $route->group(['as' => 'admin.', 'namespace' => 'SleepingOwl\Admin\Http\Controllers'], function ($route) { |
|
75 | + $this->registerRoutes(function(Router $route) { |
|
76 | + $route->group([ 'as' => 'admin.', 'namespace' => 'SleepingOwl\Admin\Http\Controllers' ], function($route) { |
|
77 | 77 | $route->get('assets/admin.scripts', [ |
78 | 78 | 'as' => 'scripts', |
79 | 79 | 'uses' => 'AdminController@getScripts', |
@@ -91,14 +91,14 @@ discard block |
||
91 | 91 | $this->app->bind(\KodiComponents\Navigation\Contracts\PageInterface::class, \SleepingOwl\Admin\Navigation\Page::class); |
92 | 92 | $this->app->bind(\KodiComponents\Navigation\Contracts\BadgeInterface::class, \SleepingOwl\Admin\Navigation\Badge::class); |
93 | 93 | |
94 | - $this->app->singleton('sleeping_owl.navigation', function () { |
|
94 | + $this->app->singleton('sleeping_owl.navigation', function() { |
|
95 | 95 | return new \SleepingOwl\Admin\Navigation(); |
96 | 96 | }); |
97 | 97 | } |
98 | 98 | |
99 | 99 | protected function registerWysiwyg() |
100 | 100 | { |
101 | - $this->app->singleton('sleeping_owl.wysiwyg', function () { |
|
101 | + $this->app->singleton('sleeping_owl.wysiwyg', function() { |
|
102 | 102 | return new \SleepingOwl\Admin\Wysiwyg\Manager(); |
103 | 103 | }); |
104 | 104 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | { |
111 | 111 | $directory = $this->getBootstrapPath(); |
112 | 112 | |
113 | - if (! is_dir($directory)) { |
|
113 | + if (!is_dir($directory)) { |
|
114 | 114 | return; |
115 | 115 | } |
116 | 116 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | ->name('/^.+\.php$/') |
120 | 120 | ->notName('routes.php') |
121 | 121 | ->notName('navigation.php') |
122 | - ->in($directory)->sort(function ($a) { |
|
122 | + ->in($directory)->sort(function($a) { |
|
123 | 123 | return $a->getFilename() != 'bootstrap.php'; |
124 | 124 | }); |
125 | 125 | |
@@ -130,13 +130,13 @@ discard block |
||
130 | 130 | |
131 | 131 | protected function registerAliases() |
132 | 132 | { |
133 | - AliasLoader::getInstance(config('sleeping_owl.aliases', [])); |
|
133 | + AliasLoader::getInstance(config('sleeping_owl.aliases', [ ])); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | protected function registerCustomRoutes() |
137 | 137 | { |
138 | 138 | if (file_exists($file = $this->getBootstrapPath('routes.php'))) { |
139 | - $this->registerRoutes(function (Router $route) use ($file) { |
|
139 | + $this->registerRoutes(function(Router $route) use ($file) { |
|
140 | 140 | require $file; |
141 | 141 | }); |
142 | 142 | } |
@@ -144,15 +144,15 @@ discard block |
||
144 | 144 | |
145 | 145 | protected function registerDefaultRoutes() |
146 | 146 | { |
147 | - $this->registerRoutes(function (Router $router) { |
|
147 | + $this->registerRoutes(function(Router $router) { |
|
148 | 148 | $router->pattern('adminModelId', '[a-zA-Z0-9_-]+'); |
149 | 149 | |
150 | - $aliases = $this->app['sleeping_owl']->modelAliases(); |
|
150 | + $aliases = $this->app[ 'sleeping_owl' ]->modelAliases(); |
|
151 | 151 | |
152 | 152 | if (count($aliases) > 0) { |
153 | 153 | $router->pattern('adminModel', implode('|', $aliases)); |
154 | 154 | |
155 | - $this->app['router']->bind('adminModel', function ($model, \Illuminate\Routing\Route $route) use ($aliases) { |
|
155 | + $this->app[ 'router' ]->bind('adminModel', function($model, \Illuminate\Routing\Route $route) use ($aliases) { |
|
156 | 156 | $class = array_search($model, $aliases); |
157 | 157 | |
158 | 158 | if ($class === false) { |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | } |
161 | 161 | |
162 | 162 | /** @var ModelConfiguration $model */ |
163 | - $model = $this->app['sleeping_owl']->getModel($class); |
|
163 | + $model = $this->app[ 'sleeping_owl' ]->getModel($class); |
|
164 | 164 | |
165 | 165 | if ($model->hasCustomControllerClass() && $route->getActionName() !== 'Closure') { |
166 | 166 | list($controller, $action) = explode('@', $route->getActionName(), 2); |
@@ -189,10 +189,10 @@ discard block |
||
189 | 189 | */ |
190 | 190 | protected function registerRoutes(\Closure $callback) |
191 | 191 | { |
192 | - $this->app['router']->group([ |
|
192 | + $this->app[ 'router' ]->group([ |
|
193 | 193 | 'prefix' => $this->getConfig('url_prefix'), |
194 | 194 | 'middleware' => $this->getConfig('middleware'), |
195 | - ], function ($route) use ($callback) { |
|
195 | + ], function($route) use ($callback) { |
|
196 | 196 | call_user_func($callback, $route); |
197 | 197 | }); |
198 | 198 | } |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | $items = include $navigation; |
204 | 204 | |
205 | 205 | if (is_array($items)) { |
206 | - $this->app['sleeping_owl.navigation']->setFromArray($items); |
|
206 | + $this->app[ 'sleeping_owl.navigation' ]->setFromArray($items); |
|
207 | 207 | } |
208 | 208 | } |
209 | 209 | } |
@@ -88,10 +88,10 @@ discard block |
||
88 | 88 | $this->controlActive = false; |
89 | 89 | |
90 | 90 | if ($this->isInitialize()) { |
91 | - $this->columns = $this->columns->filter(function ($column) { |
|
91 | + $this->columns = $this->columns->filter(function($column) { |
|
92 | 92 | $class = get_class($this->getControlColumn()); |
93 | 93 | |
94 | - return ! ($column instanceof $class); |
|
94 | + return !($column instanceof $class); |
|
95 | 95 | }); |
96 | 96 | } |
97 | 97 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function set($columns) |
115 | 115 | { |
116 | - if (! is_array($columns)) { |
|
116 | + if (!is_array($columns)) { |
|
117 | 117 | $columns = func_get_args(); |
118 | 118 | } |
119 | 119 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | |
180 | 180 | public function initialize() |
181 | 181 | { |
182 | - $this->all()->each(function (ColumnInterface $column) { |
|
182 | + $this->all()->each(function(ColumnInterface $column) { |
|
183 | 183 | $column->initialize(); |
184 | 184 | }); |
185 | 185 | |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | public function render() |
199 | 199 | { |
200 | 200 | $params = $this->toArray(); |
201 | - $params['collection'] = $this->getDisplay()->getCollection(); |
|
201 | + $params[ 'collection' ] = $this->getDisplay()->getCollection(); |
|
202 | 202 | |
203 | 203 | return app('sleeping_owl.template')->view($this->getView(), $params)->render(); |
204 | 204 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | /** |
51 | 51 | * @var array |
52 | 52 | */ |
53 | - protected $with = []; |
|
53 | + protected $with = [ ]; |
|
54 | 54 | |
55 | 55 | /** |
56 | 56 | * @var string |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $this->repository = $this->makeRepository(); |
168 | 168 | $this->repository->with($this->with); |
169 | 169 | |
170 | - $this->extensions->each(function (DisplayExtensionInterface $extension) { |
|
170 | + $this->extensions->each(function(DisplayExtensionInterface $extension) { |
|
171 | 171 | if ($extension instanceof Initializable) { |
172 | 172 | $extension->initialize(); |
173 | 173 | } |
@@ -175,10 +175,10 @@ discard block |
||
175 | 175 | if ($extension instanceof Placable) { |
176 | 176 | $template = app('sleeping_owl.template')->getViewPath($this->getView()); |
177 | 177 | |
178 | - view()->composer($template, function (\Illuminate\View\View $view) use ($extension) { |
|
178 | + view()->composer($template, function(\Illuminate\View\View $view) use ($extension) { |
|
179 | 179 | $html = app('sleeping_owl.template')->view($extension->getView(), $extension->toArray())->render(); |
180 | 180 | |
181 | - if (! empty($html)) { |
|
181 | + if (!empty($html)) { |
|
182 | 182 | $view->getFactory()->inject($extension->getPlacement(), $html); |
183 | 183 | } |
184 | 184 | }); |
@@ -213,9 +213,9 @@ discard block |
||
213 | 213 | $this->title, |
214 | 214 | ]; |
215 | 215 | |
216 | - $this->getExtensions()->each(function (DisplayExtensionInterface $extension) use (&$titles) { |
|
216 | + $this->getExtensions()->each(function(DisplayExtensionInterface $extension) use (&$titles) { |
|
217 | 217 | if (method_exists($extension, $method = 'getTitle')) { |
218 | - $titles[] = call_user_func([$extension, $method]); |
|
218 | + $titles[ ] = call_user_func([ $extension, $method ]); |
|
219 | 219 | } |
220 | 220 | }); |
221 | 221 | |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | $extension = $this->extensions->get($method); |
293 | 293 | |
294 | 294 | if (method_exists($extension, 'set')) { |
295 | - return call_user_func_array([$extension, 'set'], $arguments); |
|
295 | + return call_user_func_array([ $extension, 'set' ], $arguments); |
|
296 | 296 | } |
297 | 297 | } |
298 | 298 | |
@@ -313,9 +313,9 @@ discard block |
||
313 | 313 | */ |
314 | 314 | protected function makeRepository() |
315 | 315 | { |
316 | - $repository = app($this->repositoryClass, [$this->modelClass]); |
|
316 | + $repository = app($this->repositoryClass, [ $this->modelClass ]); |
|
317 | 317 | |
318 | - if (! ($repository instanceof RepositoryInterface)) { |
|
318 | + if (!($repository instanceof RepositoryInterface)) { |
|
319 | 319 | throw new \Exception('Repository class must be instanced of [RepositoryInterface]'); |
320 | 320 | } |
321 | 321 |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | /** |
31 | 31 | * @var array |
32 | 32 | */ |
33 | - protected $parameters = []; |
|
33 | + protected $parameters = [ ]; |
|
34 | 34 | |
35 | 35 | /** |
36 | 36 | * @var int|null |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | parent::initialize(); |
72 | 72 | |
73 | 73 | if ($this->getModelConfiguration()->isRestorableModel()) { |
74 | - $this->setApply(function ($q) { |
|
74 | + $this->setApply(function($q) { |
|
75 | 75 | return $q->withTrashed(); |
76 | 76 | }); |
77 | 77 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | */ |
133 | 133 | public function setParameter($key, $value) |
134 | 134 | { |
135 | - $this->parameters[$key] = $value; |
|
135 | + $this->parameters[ $key ] = $value; |
|
136 | 136 | |
137 | 137 | return $this; |
138 | 138 | } |
@@ -178,19 +178,19 @@ discard block |
||
178 | 178 | |
179 | 179 | $params = parent::toArray(); |
180 | 180 | |
181 | - $params['creatable'] = $model->isCreatable(); |
|
182 | - $params['createUrl'] = $model->getCreateUrl($this->getParameters() + Request::all()); |
|
183 | - $params['collection'] = $this->getCollection(); |
|
181 | + $params[ 'creatable' ] = $model->isCreatable(); |
|
182 | + $params[ 'createUrl' ] = $model->getCreateUrl($this->getParameters() + Request::all()); |
|
183 | + $params[ 'collection' ] = $this->getCollection(); |
|
184 | 184 | |
185 | - $params['extensions'] = $this->getExtensions() |
|
186 | - ->filter(function (DisplayExtensionInterface $ext) { |
|
185 | + $params[ 'extensions' ] = $this->getExtensions() |
|
186 | + ->filter(function(DisplayExtensionInterface $ext) { |
|
187 | 187 | return $ext instanceof Renderable; |
188 | 188 | }) |
189 | - ->sortBy(function (DisplayExtensionInterface $extension) { |
|
189 | + ->sortBy(function(DisplayExtensionInterface $extension) { |
|
190 | 190 | return $extension->getOrder(); |
191 | 191 | }); |
192 | 192 | |
193 | - $params['newEntryButtonText'] = $this->getNewEntryButtonText(); |
|
193 | + $params[ 'newEntryButtonText' ] = $this->getNewEntryButtonText(); |
|
194 | 194 | |
195 | 195 | return $params; |
196 | 196 | } |
@@ -211,11 +211,11 @@ discard block |
||
211 | 211 | */ |
212 | 212 | public function getCollection() |
213 | 213 | { |
214 | - if (! $this->isInitialized()) { |
|
214 | + if (!$this->isInitialized()) { |
|
215 | 215 | throw new \Exception('Display is not initialized'); |
216 | 216 | } |
217 | 217 | |
218 | - if (! is_null($this->collection)) { |
|
218 | + if (!is_null($this->collection)) { |
|
219 | 219 | return $this->collection; |
220 | 220 | } |
221 | 221 | |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | $this->modifyQuery($query); |
225 | 225 | |
226 | 226 | return $this->collection = $this->usePagination() |
227 | - ? $query->paginate($this->paginate, ['*'], $this->pageName) |
|
227 | + ? $query->paginate($this->paginate, [ '*' ], $this->pageName) |
|
228 | 228 | : $query->get(); |
229 | 229 | } |
230 | 230 | |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | */ |
234 | 234 | protected function modifyQuery(\Illuminate\Database\Eloquent\Builder $query) |
235 | 235 | { |
236 | - $this->extensions->each(function (DisplayExtensionInterface $extension) use ($query) { |
|
236 | + $this->extensions->each(function(DisplayExtensionInterface $extension) use ($query) { |
|
237 | 237 | $extension->modifyQuery($query); |
238 | 238 | }); |
239 | 239 | } |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | */ |
24 | 24 | public static function registerRoutes(Router $router) |
25 | 25 | { |
26 | - $router->get('{adminModel}/async/{adminDisplayName?}', ['as' => 'admin.model.async', |
|
27 | - function (ModelConfigurationInterface $model, $name = null) { |
|
26 | + $router->get('{adminModel}/async/{adminDisplayName?}', [ 'as' => 'admin.model.async', |
|
27 | + function(ModelConfigurationInterface $model, $name = null) { |
|
28 | 28 | $display = $model->fireDisplay(); |
29 | 29 | if ($display instanceof DisplayTabbed) { |
30 | 30 | $display = static::findDatatablesAsyncByName($display, $name); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | $totalCount = $query->count(); |
158 | 158 | $filteredCount = 0; |
159 | 159 | |
160 | - if (! is_null($this->distinct)) { |
|
160 | + if (!is_null($this->distinct)) { |
|
161 | 161 | $filteredCount = $query->distinct()->count($this->getDistinct()); |
162 | 162 | } |
163 | 163 | |
@@ -200,11 +200,11 @@ discard block |
||
200 | 200 | */ |
201 | 201 | protected function applyOrders($query) |
202 | 202 | { |
203 | - $orders = Request::input('order', []); |
|
203 | + $orders = Request::input('order', [ ]); |
|
204 | 204 | |
205 | 205 | foreach ($orders as $order) { |
206 | - $columnIndex = $order['column']; |
|
207 | - $orderDirection = $order['dir']; |
|
206 | + $columnIndex = $order[ 'column' ]; |
|
207 | + $orderDirection = $order[ 'dir' ]; |
|
208 | 208 | $column = $this->getColumns()->all()->get($columnIndex); |
209 | 209 | |
210 | 210 | if ($column instanceof NamedColumn && $column->isOrderable()) { |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | return; |
227 | 227 | } |
228 | 228 | |
229 | - $query->where(function ($query) use ($search) { |
|
229 | + $query->where(function($query) use ($search) { |
|
230 | 230 | $columns = $this->getColumns()->all(); |
231 | 231 | foreach ($columns as $column) { |
232 | 232 | if (in_array(get_class($column), $this->searchableColumns)) { |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | */ |
245 | 245 | protected function applyColumnSearch(Builder $query) |
246 | 246 | { |
247 | - $queryColumns = Request::input('columns', []); |
|
247 | + $queryColumns = Request::input('columns', [ ]); |
|
248 | 248 | |
249 | 249 | foreach ($queryColumns as $index => $queryColumn) { |
250 | 250 | $search = array_get($queryColumn, 'search.value'); |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | $column = $this->getColumns()->all()->get($index); |
253 | 253 | $columnFilter = array_get($this->getColumnFilters()->all(), $index); |
254 | 254 | |
255 | - if (! is_null($columnFilter) && ! is_null($column)) { |
|
255 | + if (!is_null($columnFilter) && !is_null($column)) { |
|
256 | 256 | $columnFilter->apply($this->repository, $column, $query, $search, $fullSearch); |
257 | 257 | } |
258 | 258 | } |
@@ -271,21 +271,21 @@ discard block |
||
271 | 271 | { |
272 | 272 | $columns = $this->getColumns(); |
273 | 273 | |
274 | - $result = []; |
|
275 | - $result['draw'] = Request::input('draw', 0); |
|
276 | - $result['recordsTotal'] = $totalCount; |
|
277 | - $result['recordsFiltered'] = $filteredCount; |
|
278 | - $result['data'] = []; |
|
274 | + $result = [ ]; |
|
275 | + $result[ 'draw' ] = Request::input('draw', 0); |
|
276 | + $result[ 'recordsTotal' ] = $totalCount; |
|
277 | + $result[ 'recordsFiltered' ] = $filteredCount; |
|
278 | + $result[ 'data' ] = [ ]; |
|
279 | 279 | |
280 | 280 | foreach ($collection as $instance) { |
281 | - $_row = []; |
|
281 | + $_row = [ ]; |
|
282 | 282 | |
283 | 283 | foreach ($columns->all() as $column) { |
284 | 284 | $column->setModel($instance); |
285 | - $_row[] = (string) $column; |
|
285 | + $_row[ ] = (string) $column; |
|
286 | 286 | } |
287 | 287 | |
288 | - $result['data'][] = $_row; |
|
288 | + $result[ 'data' ][ ] = $_row; |
|
289 | 289 | } |
290 | 290 | |
291 | 291 | return $result; |