@@ -134,6 +134,6 @@ |
||
| 134 | 134 | */ |
| 135 | 135 | protected function getStub() |
| 136 | 136 | { |
| 137 | - return __DIR__ . '/Lib/stubs/datatable-class-template.stub'; |
|
| 137 | + return __DIR__.'/Lib/stubs/datatable-class-template.stub'; |
|
| 138 | 138 | } |
| 139 | 139 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | " ->add('", |
| 22 | 22 | $field, |
| 23 | 23 | "', null", |
| 24 | - ", trans('datatable." . strtolower($field) . "')", |
|
| 24 | + ", trans('datatable.".strtolower($field)."')", |
|
| 25 | 25 | ")", |
| 26 | 26 | ($isLast) ? "" : "\n" |
| 27 | 27 | ]; |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | ); |
| 43 | 43 | |
| 44 | 44 | |
| 45 | - $this->app->singleton('datatable',function() |
|
| 45 | + $this->app->singleton('datatable', function() |
|
| 46 | 46 | { |
| 47 | 47 | return new Datatable; |
| 48 | 48 | }); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | * |
| 98 | 98 | * @param string $name |
| 99 | 99 | * @param \Closure|null $closure |
| 100 | - * @param string|\Symfony\Component\Translation\TranslatorInterface $translation |
|
| 100 | + * @param string $translation |
|
| 101 | 101 | * @param bool $orderable |
| 102 | 102 | * @return $this |
| 103 | 103 | */ |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | * Add orderable column. |
| 135 | 135 | * |
| 136 | 136 | * @param string $name |
| 137 | - * @param bool $translation |
|
| 137 | + * @param boolean $orderable |
|
| 138 | 138 | * @return void |
| 139 | 139 | */ |
| 140 | 140 | public function addOrderable($name, $orderable) |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | /** |
| 146 | 146 | * Generate specified columns for current datatable. |
| 147 | 147 | * |
| 148 | - * @return mixed |
|
| 148 | + * @return \Illuminate\Http\JsonResponse |
|
| 149 | 149 | */ |
| 150 | 150 | public function generateColomns() |
| 151 | 151 | { |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | */ |
| 104 | 104 | public function add($name, $closure = null, $translation = '', $orderable = true) |
| 105 | 105 | { |
| 106 | - if (! empty($closure)) { |
|
| 106 | + if (!empty($closure)) { |
|
| 107 | 107 | $this->colomns[] = [ |
| 108 | 108 | $name, |
| 109 | 109 | $closure, |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | */ |
| 128 | 128 | public function addTranslation($name, $translation) |
| 129 | 129 | { |
| 130 | - $this->colomnsDisplay[] = ! empty($translation) ? $translation : ucfirst($name); |
|
| 130 | + $this->colomnsDisplay[] = !empty($translation) ? $translation : ucfirst($name); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | /** |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | $colSearchAndSort = []; |
| 158 | 158 | $sortOnly = []; |
| 159 | 159 | |
| 160 | - if (! empty($this->colomns)) { |
|
| 160 | + if (!empty($this->colomns)) { |
|
| 161 | 161 | foreach ($this->colomns as $key => $value) { |
| 162 | 162 | |
| 163 | 163 | if (is_string($value)) { |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | */ |
| 198 | 198 | public function setClassRow($datatable) |
| 199 | 199 | { |
| 200 | - $datatable->setRowClass(function ($row) { |
|
| 200 | + $datatable->setRowClass(function($row) { |
|
| 201 | 201 | return (isset($row->status) && empty($row->status)) ? 'danger' : ''; |
| 202 | 202 | }); |
| 203 | 203 | |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | 'colomns_display' => $this->colomnsDisplay, |
| 218 | 218 | 'datatable_options' => $this->addOptions(), |
| 219 | 219 | 'id' => strtolower(str_replace('\\', '_', get_class($this))), |
| 220 | - 'route' => ! empty($route) ? $route : $this->getControllerNameForAction() . '@getDatatable', |
|
| 220 | + 'route' => !empty($route) ? $route : $this->getControllerNameForAction().'@getDatatable', |
|
| 221 | 221 | 'filters' => $this->addFilter(), |
| 222 | 222 | ]); |
| 223 | 223 | } |
@@ -233,10 +233,10 @@ discard block |
||
| 233 | 233 | { |
| 234 | 234 | $reflection = new ReflectionClass(get_class($this)); |
| 235 | 235 | |
| 236 | - $this->add('actions', function ($model) use ($template, $reflection, $route) { |
|
| 236 | + $this->add('actions', function($model) use ($template, $reflection, $route) { |
|
| 237 | 237 | return view($template, [ |
| 238 | 238 | 'data' => $model->toArray(), |
| 239 | - 'route' => ! empty($route) ? $route . '@' : $this->getControllerNameForAction() . '@', |
|
| 239 | + 'route' => !empty($route) ? $route.'@' : $this->getControllerNameForAction().'@', |
|
| 240 | 240 | ])->render(); |
| 241 | 241 | }, 'Actions', false); |
| 242 | 242 | } |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | */ |
| 269 | 269 | protected function addOptions() |
| 270 | 270 | { |
| 271 | - if (! array_key_exists('order', $this->datatableOptions) && ! empty($this->defaultOrder)) { |
|
| 271 | + if (!array_key_exists('order', $this->datatableOptions) && !empty($this->defaultOrder)) { |
|
| 272 | 272 | if (is_array($this->defaultOrder)) { |
| 273 | 273 | foreach ($this->defaultOrder as $keyOrder => $order) { |
| 274 | 274 | if (is_string($order[0])) { |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | { |
| 314 | 314 | $action = explode('@', Route::currentRouteAction()); |
| 315 | 315 | |
| 316 | - return '\\' . $action[0]; |
|
| 316 | + return '\\'.$action[0]; |
|
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | /** |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | $allInput = Request::all(); |
| 339 | 339 | foreach ($allInput as $name => $input) { |
| 340 | 340 | if (in_array($name, $columns) && ($input != '')) { |
| 341 | - $this->model = $this->model->where($this->table . '.' . $name, '=', $input); |
|
| 341 | + $this->model = $this->model->where($this->table.'.'.$name, '=', $input); |
|
| 342 | 342 | } |
| 343 | 343 | } |
| 344 | 344 | } |