@@ -80,14 +80,14 @@ discard block |
||
| 80 | 80 | $this->extensionDir = $this->ask('Please input a directory to store your extension:'); |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - if (! file_exists($this->extensionDir)) { |
|
| 83 | + if (!file_exists($this->extensionDir)) { |
|
| 84 | 84 | $this->makeDir(); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | $this->package = $this->argument('extension'); |
| 88 | 88 | |
| 89 | 89 | InputExtensionName: |
| 90 | - if (! $this->validateExtensionName($this->package)) { |
|
| 90 | + if (!$this->validateExtensionName($this->package)) { |
|
| 91 | 91 | $this->package = $this->ask("[$this->package] is not a valid package name, please input a name like (<vendor>/<name>)"); |
| 92 | 92 | goto InputExtensionName; |
| 93 | 93 | } |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | */ |
| 195 | 195 | protected function getRootNameSpace() |
| 196 | 196 | { |
| 197 | - if (! $namespace = $this->option('namespace')) { |
|
| 197 | + if (!$namespace = $this->option('namespace')) { |
|
| 198 | 198 | [$vendor, $name] = explode('/', $this->package); |
| 199 | 199 | |
| 200 | 200 | $default = str_replace(['-', '-'], '', Str::title($vendor).'\\'.Str::title($name)); |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | return; |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | - if (! file_exists($from)) { |
|
| 287 | + if (!file_exists($from)) { |
|
| 288 | 288 | return; |
| 289 | 289 | } |
| 290 | 290 | |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | $slug = $this->generateSlug($table, $permission); |
| 65 | 65 | $name = $this->generateName($table, $permission_lang); |
| 66 | 66 | $exists = Permission::where('slug', $slug)->exists(); |
| 67 | - if (! $exists) { |
|
| 67 | + if (!$exists) { |
|
| 68 | 68 | Permission::create([ |
| 69 | 69 | 'name' => $name, |
| 70 | 70 | 'slug' => $slug, |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | return $model; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - if (! class_exists($model) || ! is_string($model) || ! is_subclass_of($model, Model::class)) { |
|
| 69 | + if (!class_exists($model) || !is_string($model) || !is_subclass_of($model, Model::class)) { |
|
| 70 | 70 | throw new \InvalidArgumentException("Invalid model [$model] !"); |
| 71 | 71 | } |
| 72 | 72 | |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | */ |
| 214 | 214 | protected function getTableColumns() |
| 215 | 215 | { |
| 216 | - if (! $this->model->getConnection()->isDoctrineAvailable()) { |
|
| 216 | + if (!$this->model->getConnection()->isDoctrineAvailable()) { |
|
| 217 | 217 | throw new \Exception( |
| 218 | 218 | 'You need to require doctrine/dbal: ~2.3 in your own composer.json to get database columns. ' |
| 219 | 219 | ); |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | */ |
| 28 | 28 | public function handle() |
| 29 | 29 | { |
| 30 | - if (! $this->confirm('Are you sure to uninstall laravel-admin?')) { |
|
| 30 | + if (!$this->confirm('Are you sure to uninstall laravel-admin?')) { |
|
| 31 | 31 | return; |
| 32 | 32 | } |
| 33 | 33 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $all = $fields->toArray(); |
| 71 | 71 | |
| 72 | 72 | foreach ($this->form->rows as $row) { |
| 73 | - $rowFields = array_map(function ($field) { |
|
| 73 | + $rowFields = array_map(function($field) { |
|
| 74 | 74 | return $field['element']; |
| 75 | 75 | }, $row->getFields()); |
| 76 | 76 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | foreach ($rowFields as $field) { |
| 80 | 80 | if (($index = array_search($field, $all)) !== false) { |
| 81 | - if (! $match) { |
|
| 81 | + if (!$match) { |
|
| 82 | 82 | $fields->put($index, $row); |
| 83 | 83 | } else { |
| 84 | 84 | $fields->pull($index); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | public function getTabs() |
| 105 | 105 | { |
| 106 | 106 | // If there is no active tab, then active the first. |
| 107 | - if ($this->tabs->filter(function ($tab) { |
|
| 107 | + if ($this->tabs->filter(function($tab) { |
|
| 108 | 108 | return $tab['active']; |
| 109 | 109 | })->isEmpty()) { |
| 110 | 110 | $first = $this->tabs->first(); |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | */ |
| 337 | 337 | public function field($name) |
| 338 | 338 | { |
| 339 | - return $this->fields()->first(function (Field $field) use ($name) { |
|
| 339 | + return $this->fields()->first(function(Field $field) use ($name) { |
|
| 340 | 340 | return $field->column() === $name; |
| 341 | 341 | }); |
| 342 | 342 | } |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | */ |
| 349 | 349 | public function hasRows(): bool |
| 350 | 350 | { |
| 351 | - return ! empty($this->form->rows); |
|
| 351 | + return !empty($this->form->rows); |
|
| 352 | 352 | } |
| 353 | 353 | |
| 354 | 354 | /** |
@@ -459,7 +459,7 @@ discard block |
||
| 459 | 459 | { |
| 460 | 460 | $previous = URL::previous(); |
| 461 | 461 | |
| 462 | - if (! $previous || $previous === URL::current()) { |
|
| 462 | + if (!$previous || $previous === URL::current()) { |
|
| 463 | 463 | return; |
| 464 | 464 | } |
| 465 | 465 | |
@@ -523,7 +523,7 @@ discard block |
||
| 523 | 523 | */ |
| 524 | 524 | protected function removeReservedFields() |
| 525 | 525 | { |
| 526 | - if (! $this->isCreating()) { |
|
| 526 | + if (!$this->isCreating()) { |
|
| 527 | 527 | return; |
| 528 | 528 | } |
| 529 | 529 | |
@@ -535,7 +535,7 @@ discard block |
||
| 535 | 535 | |
| 536 | 536 | $this->form->getLayout()->removeReservedFields($reservedColumns); |
| 537 | 537 | |
| 538 | - $this->fields = $this->fields()->reject(function (Field $field) use ($reservedColumns) { |
|
| 538 | + $this->fields = $this->fields()->reject(function(Field $field) use ($reservedColumns) { |
|
| 539 | 539 | return in_array($field->column(), $reservedColumns, true); |
| 540 | 540 | }); |
| 541 | 541 | } |
@@ -571,7 +571,7 @@ discard block |
||
| 571 | 571 | |
| 572 | 572 | $tabObj = $this->form->setTab(); |
| 573 | 573 | |
| 574 | - if (! $tabObj->isEmpty()) { |
|
| 574 | + if (!$tabObj->isEmpty()) { |
|
| 575 | 575 | $script = <<<'SCRIPT' |
| 576 | 576 | |
| 577 | 577 | var hash = document.location.hash; |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | $rules = $attributes = []; |
| 84 | 84 | |
| 85 | - if (! $fieldRules = $this->getRules()) { |
|
| 85 | + if (!$fieldRules = $this->getRules()) { |
|
| 86 | 86 | return false; |
| 87 | 87 | } |
| 88 | 88 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | $path = null; |
| 125 | 125 | |
| 126 | - if (! is_null($this->storagePermission)) { |
|
| 126 | + if (!is_null($this->storagePermission)) { |
|
| 127 | 127 | $path = $this->storage->putFileAs($this->getDirectory(), $file, $this->name, $this->storagePermission); |
| 128 | 128 | } else { |
| 129 | 129 | $path = $this->storage->putFileAs($this->getDirectory(), $file, $this->name); |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | |
| 235 | 235 | $this->setupDefaultOptions(); |
| 236 | 236 | |
| 237 | - if (! empty($this->value)) { |
|
| 237 | + if (!empty($this->value)) { |
|
| 238 | 238 | $this->attribute('data-initial-preview', $this->preview()); |
| 239 | 239 | $this->attribute('data-initial-caption', $this->initialCaption($this->value)); |
| 240 | 240 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | */ |
| 78 | 78 | public function pluck($visibleColumn, $key) |
| 79 | 79 | { |
| 80 | - if (! empty($visibleColumn) && ! empty($key)) { |
|
| 80 | + if (!empty($visibleColumn) && !empty($key)) { |
|
| 81 | 81 | $this->keyAsValue = true; |
| 82 | 82 | } |
| 83 | 83 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | public function options($options = []) |
| 98 | 98 | { |
| 99 | - if (! $this->keyAsValue) { |
|
| 99 | + if (!$this->keyAsValue) { |
|
| 100 | 100 | return parent::options($options); |
| 101 | 101 | } |
| 102 | 102 | |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | return is_null($this->saveAction) ? $value : ($this->saveAction)($value); |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | - if (is_array($value) && ! Arr::isAssoc($value)) { |
|
| 141 | + if (is_array($value) && !Arr::isAssoc($value)) { |
|
| 142 | 142 | $value = implode(',', $value); |
| 143 | 143 | } |
| 144 | 144 | |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | public function __construct($column, $arguments = []) |
| 14 | 14 | { |
| 15 | - if (! class_exists(\Mews\Captcha\Captcha::class)) { |
|
| 15 | + if (!class_exists(\Mews\Captcha\Captcha::class)) { |
|
| 16 | 16 | throw new \Exception('To use captcha field, please install [mews/captcha] first.'); |
| 17 | 17 | } |
| 18 | 18 | |