@@ -54,7 +54,7 @@ |
||
| 54 | 54 | */ |
| 55 | 55 | public function setModel($model) |
| 56 | 56 | { |
| 57 | - if (! class_exists($model)) { |
|
| 57 | + if (!class_exists($model)) { |
|
| 58 | 58 | throw new Exception("Class model [$model] not found"); |
| 59 | 59 | } |
| 60 | 60 | |
@@ -11,12 +11,12 @@ discard block |
||
| 11 | 11 | /** |
| 12 | 12 | * @var array |
| 13 | 13 | */ |
| 14 | - protected $order = [[0, 'asc']]; |
|
| 14 | + protected $order = [ [ 0, 'asc' ] ]; |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * @var array |
| 18 | 18 | */ |
| 19 | - protected $datatableAttributes = []; |
|
| 19 | + protected $datatableAttributes = [ ]; |
|
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | 22 | * @var int |
@@ -39,12 +39,12 @@ discard block |
||
| 39 | 39 | $this->setHtmlAttribute('data-order', json_encode($this->getOrder())); |
| 40 | 40 | |
| 41 | 41 | $attributes = $this->getDatatableAttributes(); |
| 42 | - $attributes['pageLength'] = $this->paginate; |
|
| 42 | + $attributes[ 'pageLength' ] = $this->paginate; |
|
| 43 | 43 | |
| 44 | - $attributes['language'] = trans('sleeping_owl::lang.table'); |
|
| 44 | + $attributes[ 'language' ] = trans('sleeping_owl::lang.table'); |
|
| 45 | 45 | |
| 46 | 46 | foreach ($this->getColumns()->all() as $column) { |
| 47 | - $attributes['columns'][] = [ |
|
| 47 | + $attributes[ 'columns' ][ ] = [ |
|
| 48 | 48 | 'orderDataType' => class_basename($column), |
| 49 | 49 | ]; |
| 50 | 50 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public function getDatatableAttributes() |
| 59 | 59 | { |
| 60 | - return array_merge(config('sleeping_owl.datatables', []), (array) $this->datatableAttributes); |
|
| 60 | + return array_merge(config('sleeping_owl.datatables', [ ]), (array) $this->datatableAttributes); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | public function setOrder($order) |
| 89 | 89 | { |
| 90 | - if (! is_array($order)) { |
|
| 90 | + if (!is_array($order)) { |
|
| 91 | 91 | $order = func_get_args(); |
| 92 | 92 | } |
| 93 | 93 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | { |
| 123 | 123 | $params = parent::toArray(); |
| 124 | 124 | |
| 125 | - $params['order'] = $this->getOrder(); |
|
| 125 | + $params[ 'order' ] = $this->getOrder(); |
|
| 126 | 126 | |
| 127 | 127 | return $params; |
| 128 | 128 | } |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | /** |
| 15 | 15 | * @var DisplayTab[] |
| 16 | 16 | */ |
| 17 | - protected $tabs = []; |
|
| 17 | + protected $tabs = [ ]; |
|
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * @var string |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | { |
| 80 | 80 | $tab = app('sleeping_owl.display')->tab($display)->setLabel($label)->setActive($active); |
| 81 | 81 | |
| 82 | - $this->tabs[] = $tab; |
|
| 82 | + $this->tabs[ ] = $tab; |
|
| 83 | 83 | |
| 84 | 84 | return $tab; |
| 85 | 85 | } |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | foreach ($this->getTabs() as $tab) { |
| 119 | 119 | if ($tab instanceof FormInterface) { |
| 120 | 120 | $result = $tab->validateForm($model); |
| 121 | - if (! is_null($result)) { |
|
| 121 | + if (!is_null($result)) { |
|
| 122 | 122 | return $result; |
| 123 | 123 | } |
| 124 | 124 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | { |
| 56 | 56 | $this->header = app(TableHeaderColumnInterface::class); |
| 57 | 57 | |
| 58 | - if (! is_null($label)) { |
|
| 58 | + if (!is_null($label)) { |
|
| 59 | 59 | $this->setLabel($label); |
| 60 | 60 | } |
| 61 | 61 | } |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | $this->model = $model; |
| 160 | 160 | $append = $this->getAppends(); |
| 161 | 161 | |
| 162 | - if (! is_null($append)) { |
|
| 162 | + if (!is_null($append)) { |
|
| 163 | 163 | $append->setModel($model); |
| 164 | 164 | } |
| 165 | 165 | |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | $parts = explode('.', $name); |
| 67 | 67 | $fieldName = array_pop($parts); |
| 68 | 68 | $relationName = implode('.', $parts); |
| 69 | - $query->whereHas($relationName, function ($q) use ($search, $fieldName) { |
|
| 69 | + $query->whereHas($relationName, function($q) use ($search, $fieldName) { |
|
| 70 | 70 | $this->buildQuery($q, $fieldName, $search); |
| 71 | 71 | }); |
| 72 | 72 | } |
@@ -189,7 +189,7 @@ |
||
| 189 | 189 | $fieldName = array_pop($parts); |
| 190 | 190 | $relationName = implode('.', $parts); |
| 191 | 191 | |
| 192 | - $query->whereHas($relationName, function ($q) use ($name, $time) { |
|
| 192 | + $query->whereHas($relationName, function($q) use ($name, $time) { |
|
| 193 | 193 | $this->buildQuery($q, $name, $time); |
| 194 | 194 | }); |
| 195 | 195 | } |
@@ -106,14 +106,14 @@ |
||
| 106 | 106 | $from = array_get($fullSearch, 'from'); |
| 107 | 107 | $to = array_get($fullSearch, 'to'); |
| 108 | 108 | |
| 109 | - if (! empty($from)) { |
|
| 109 | + if (!empty($from)) { |
|
| 110 | 110 | $this |
| 111 | 111 | ->getFrom() |
| 112 | 112 | ->setOperator(FilterInterface::LESS_OR_EQUAL) |
| 113 | 113 | ->apply($repository, $column, $query, $from, $fullSearch); |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - if (! empty($to)) { |
|
| 116 | + if (!empty($to)) { |
|
| 117 | 117 | $this |
| 118 | 118 | ->getTo() |
| 119 | 119 | ->setOperator(FilterInterface::LESS_OR_EQUAL) |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | */ |
| 41 | 41 | public function toArray() |
| 42 | 42 | { |
| 43 | - return []; |
|
| 43 | + return [ ]; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | /** |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | /** |
| 29 | 29 | * @var array |
| 30 | 30 | */ |
| 31 | - protected $options = []; |
|
| 31 | + protected $options = [ ]; |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * @var string |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $model = new $model; |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - if (! ($model instanceof Model)) { |
|
| 63 | + if (!($model instanceof Model)) { |
|
| 64 | 64 | throw new \Exception('Model must be an instance of Illuminate\Database\Eloquent\Model'); |
| 65 | 65 | } |
| 66 | 66 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | public function getOptions() |
| 116 | 116 | { |
| 117 | - if (! is_null($this->getModel()) and ! is_null($this->getDisplay())) { |
|
| 117 | + if (!is_null($this->getModel()) and !is_null($this->getDisplay())) { |
|
| 118 | 118 | $this->loadOptions(); |
| 119 | 119 | } |
| 120 | 120 | |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | $parts = explode('.', $name); |
| 201 | 201 | $fieldName = array_pop($parts); |
| 202 | 202 | $relationName = implode('.', $parts); |
| 203 | - $query->whereHas($relationName, function ($q) use ($search, $fieldName) { |
|
| 203 | + $query->whereHas($relationName, function($q) use ($search, $fieldName) { |
|
| 204 | 204 | $this->buildQuery($q, $fieldName, $search); |
| 205 | 205 | }); |
| 206 | 206 | } |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | |
| 209 | 209 | protected function loadOptions() |
| 210 | 210 | { |
| 211 | - $repository = app(RepositoryInterface::class, [$this->getModel()]); |
|
| 211 | + $repository = app(RepositoryInterface::class, [ $this->getModel() ]); |
|
| 212 | 212 | |
| 213 | 213 | $key = $repository->getModel()->getKeyName(); |
| 214 | 214 | $options = $repository->getQuery()->get()->lists($this->getDisplay(), $key); |