@@ -8,10 +8,10 @@ |
||
8 | 8 | <?php $active = null; ?> |
9 | 9 | @foreach ($items as $label => $_tmp) |
10 | 10 | <?php |
11 | - if (is_null($active)) { |
|
12 | - $active = $label; |
|
13 | - } |
|
14 | - ?> |
|
11 | + if (is_null($active)) { |
|
12 | + $active = $label; |
|
13 | + } |
|
14 | + ?> |
|
15 | 15 | <li role="presentation" {!! ($active == $label) ? 'class="active"' : '' !!}><a href="#{{ md5($label) }}" aria-controls="{{ md5($label) }}" role="tab" data-toggle="tab">{{ $label }}</a></li> |
16 | 16 | @endforeach |
17 | 17 | </ul> |
@@ -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 |
@@ -13,7 +13,6 @@ |
||
13 | 13 | |
14 | 14 | /** |
15 | 15 | * Class DisplayTable. |
16 | - |
|
17 | 16 | * @method Columns getColumns() |
18 | 17 | * @method $this setColumns(ColumnInterface $column, ... $columns) |
19 | 18 | * |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | parent::initialize(); |
71 | 71 | |
72 | 72 | if ($this->getModelConfiguration()->isRestorableModel()) { |
73 | - $this->setApply(function ($q) { |
|
73 | + $this->setApply(function($q) { |
|
74 | 74 | return $q->withTrashed(); |
75 | 75 | }); |
76 | 76 | } |
@@ -192,11 +192,11 @@ discard block |
||
192 | 192 | */ |
193 | 193 | public function getCollection() |
194 | 194 | { |
195 | - if (! $this->isInitialized()) { |
|
195 | + if (!$this->isInitialized()) { |
|
196 | 196 | throw new \Exception('Display is not initialized'); |
197 | 197 | } |
198 | 198 | |
199 | - if (! is_null($this->collection)) { |
|
199 | + if (!is_null($this->collection)) { |
|
200 | 200 | return $this->collection; |
201 | 201 | } |
202 | 202 |
@@ -89,9 +89,9 @@ |
||
89 | 89 | parent::initialize(); |
90 | 90 | |
91 | 91 | $this->getRepository() |
92 | - ->setParentField($this->getParentField()) |
|
93 | - ->setOrderField($this->getOrderField()) |
|
94 | - ->setRootParentId($this->getRootParentId()); |
|
92 | + ->setParentField($this->getParentField()) |
|
93 | + ->setOrderField($this->getOrderField()) |
|
94 | + ->setRootParentId($this->getRootParentId()); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | public static function registerRoutes(Router $router) |
23 | 23 | { |
24 | 24 | $routeName = 'admin.display.tree.reorder'; |
25 | - if (! $router->has($routeName)) { |
|
25 | + if (!$router->has($routeName)) { |
|
26 | 26 | $router->post('{adminModel}/reorder', ['as' => $routeName, 'uses' => 'SleepingOwl\Admin\Http\Controllers\DisplayController@treeReorder']); |
27 | 27 | } |
28 | 28 | } |
@@ -260,11 +260,11 @@ discard block |
||
260 | 260 | */ |
261 | 261 | public function getCollection() |
262 | 262 | { |
263 | - if (! $this->isInitialized()) { |
|
263 | + if (!$this->isInitialized()) { |
|
264 | 264 | throw new \Exception('Display is not initialized'); |
265 | 265 | } |
266 | 266 | |
267 | - if (! is_null($this->collection)) { |
|
267 | + if (!is_null($this->collection)) { |
|
268 | 268 | return $this->collection; |
269 | 269 | } |
270 | 270 | |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | { |
296 | 296 | $repository = parent::makeRepository(); |
297 | 297 | |
298 | - if (! ($repository instanceof TreeRepositoryInterface)) { |
|
298 | + if (!($repository instanceof TreeRepositoryInterface)) { |
|
299 | 299 | throw new \Exception('Repository class must be instanced of [TreeRepositoryInterface]'); |
300 | 300 | } |
301 | 301 |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | public function __construct($label = null, Closure $callback = null) |
29 | 29 | { |
30 | 30 | parent::__construct($label); |
31 | - if (! is_null($callback)) { |
|
31 | + if (!is_null($callback)) { |
|
32 | 32 | $this->setCallback($callback); |
33 | 33 | } |
34 | 34 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | protected function getValue(Model $model) |
65 | 65 | { |
66 | - if (! is_callable($callback = $this->getCallback())) { |
|
66 | + if (!is_callable($callback = $this->getCallback())) { |
|
67 | 67 | throw new \Exception('Invalid custom column callback'); |
68 | 68 | } |
69 | 69 |
@@ -46,7 +46,7 @@ |
||
46 | 46 | public function toArray() |
47 | 47 | { |
48 | 48 | $value = $this->getModelValue(); |
49 | - if (! empty($value) && (strpos($value, '://') === false)) { |
|
49 | + if (!empty($value) && (strpos($value, '://') === false)) { |
|
50 | 50 | $value = asset($value); |
51 | 51 | } |
52 | 52 |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function set($actions) |
51 | 51 | { |
52 | - if (! is_array($actions)) { |
|
52 | + if (!is_array($actions)) { |
|
53 | 53 | $actions = func_get_args(); |
54 | 54 | } |
55 | 55 | |
@@ -145,13 +145,13 @@ discard block |
||
145 | 145 | return; |
146 | 146 | } |
147 | 147 | |
148 | - $this->all()->each(function (ActionInterface $action) { |
|
148 | + $this->all()->each(function(ActionInterface $action) { |
|
149 | 149 | $action->initialize(); |
150 | 150 | }); |
151 | 151 | |
152 | 152 | $this->setHtmlAttribute('data-type', 'display-actions'); |
153 | 153 | |
154 | - if (! $this->hasHtmlAttribute('class')) { |
|
154 | + if (!$this->hasHtmlAttribute('class')) { |
|
155 | 155 | $this->setHtmlAttribute('class', 'panel-footer'); |
156 | 156 | } |
157 | 157 | } |
@@ -152,7 +152,7 @@ |
||
152 | 152 | |
153 | 153 | public function initialize() |
154 | 154 | { |
155 | - $this->allWithControl()->each(function (ColumnInterface $column) { |
|
155 | + $this->allWithControl()->each(function(ColumnInterface $column) { |
|
156 | 156 | $column->initialize(); |
157 | 157 | }); |
158 | 158 |
@@ -73,8 +73,8 @@ |
||
73 | 73 | protected function updateOrderFieldOnDelete() |
74 | 74 | { |
75 | 75 | static::orderModel() |
76 | - ->where($this->getOrderField(), '>', $this->getOrderValue()) |
|
77 | - ->decrement($this->getOrderField()); |
|
76 | + ->where($this->getOrderField(), '>', $this->getOrderValue()) |
|
77 | + ->decrement($this->getOrderField()); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | /** |
@@ -9,11 +9,11 @@ |
||
9 | 9 | */ |
10 | 10 | protected static function bootOrderableModel() |
11 | 11 | { |
12 | - static::creating(function ($row) { |
|
12 | + static::creating(function($row) { |
|
13 | 13 | $row->updateOrderFieldOnCreate(); |
14 | 14 | }); |
15 | 15 | |
16 | - static::deleted(function ($row) { |
|
16 | + static::deleted(function($row) { |
|
17 | 17 | $row->updateOrderFieldOnDelete(); |
18 | 18 | }); |
19 | 19 | } |