@@ -71,7 +71,7 @@ |
||
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | //Sort alphabetically de menu items |
| 74 | - usort($menuItems, function ($itemA, $itemB) { |
|
| 74 | + usort($menuItems, function($itemA, $itemB) { |
|
| 75 | 75 | return strcmp($itemA['name'], $itemB['name']); |
| 76 | 76 | }); |
| 77 | 77 | |
@@ -441,7 +441,7 @@ discard block |
||
| 441 | 441 | $fieldName = $field->getName(); |
| 442 | 442 | $requestValue = $request->input("main.{$fieldName}"); |
| 443 | 443 | |
| 444 | - if (! empty($foreignFields) && (! empty($foreignFields[$fieldName])) && (empty($requestValue))) { |
|
| 444 | + if (!empty($foreignFields) && (!empty($foreignFields[$fieldName])) && (empty($requestValue))) { |
|
| 445 | 445 | $requestValue = null; |
| 446 | 446 | } |
| 447 | 447 | |
@@ -471,9 +471,9 @@ discard block |
||
| 471 | 471 | continue; |
| 472 | 472 | } |
| 473 | 473 | |
| 474 | - if (! empty($requestValue) |
|
| 474 | + if (!empty($requestValue) |
|
| 475 | 475 | || (empty($requestValue) && !empty($item->getAttribute($fieldName))) |
| 476 | - || (! empty($foreignFields) && (! empty($foreignFields[$fieldName])) && (empty($requestValue))) |
|
| 476 | + || (!empty($foreignFields) && (!empty($foreignFields[$fieldName])) && (empty($requestValue))) |
|
| 477 | 477 | ) { |
| 478 | 478 | $item->setAttribute( |
| 479 | 479 | $fieldName, |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | 'prefix' => 'crud', |
| 6 | 6 | 'namespace' => 'Anavel\Crud\Http\Controllers', |
| 7 | 7 | ], |
| 8 | - function () { |
|
| 8 | + function() { |
|
| 9 | 9 | Route::get('/', [ |
| 10 | 10 | 'as' => 'anavel-crud.home', |
| 11 | 11 | 'uses' => 'HomeController@index', |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | // If results are displayed using a field other than id, order by that field |
| 49 | - if (! empty($this->config['display'])) { |
|
| 49 | + if (!empty($this->config['display'])) { |
|
| 50 | 50 | asort($options); |
| 51 | 51 | } |
| 52 | 52 | |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | public function setup() |
| 20 | 20 | { |
| 21 | 21 | if (empty($this->langs)) { |
| 22 | - $this->langs = (array)config('anavel.translation_languages'); |
|
| 22 | + $this->langs = (array) config('anavel.translation_languages'); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | $this->checkRelationCompatibility(); |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | public function apply($model, Repository $repository) |
| 20 | 20 | { |
| 21 | - return $model->where(function ($query) { |
|
| 21 | + return $model->where(function($query) { |
|
| 22 | 22 | $firstColumn = array_shift($this->columns); |
| 23 | 23 | |
| 24 | 24 | if (strpos($firstColumn, '.')) { |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | private function getRelationClosure(array $relations) |
| 55 | 55 | { |
| 56 | - return function ($query) use ($relations) { |
|
| 56 | + return function($query) use ($relations) { |
|
| 57 | 57 | $relation = array_shift($relations); |
| 58 | 58 | |
| 59 | 59 | if (count($relations) > 0) { |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | return $model; |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - return $model->with([array_shift($this->relation) => function ($q) { |
|
| 28 | + return $model->with([array_shift($this->relation) => function($q) { |
|
| 29 | 29 | $this->setWith($q); |
| 30 | 30 | }]); |
| 31 | 31 | } |
@@ -145,7 +145,7 @@ |
||
| 145 | 145 | |
| 146 | 146 | $this->getIndexRequirements($request, $modelAbstractor, $repository); |
| 147 | 147 | |
| 148 | - $csv = (string)(new Csv)->fromArray($repository->all()->toArray()); |
|
| 148 | + $csv = (string) (new Csv)->fromArray($repository->all()->toArray()); |
|
| 149 | 149 | |
| 150 | 150 | return response()->make($csv, 200, [ |
| 151 | 151 | 'Content-Encoding' => 'UTF-8', |
@@ -59,18 +59,18 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | $this->app->register('ANavallaSuiza\Laravel\Database\Manager\ModelManagerServiceProvider'); |
| 61 | 61 | |
| 62 | - $this->app->bind('Anavel\Crud\Contracts\Abstractor\FieldFactory', function () { |
|
| 62 | + $this->app->bind('Anavel\Crud\Contracts\Abstractor\FieldFactory', function() { |
|
| 63 | 63 | return new FieldAbstractorFactory(new FormFactory()); |
| 64 | 64 | }); |
| 65 | 65 | |
| 66 | - $this->app->bind('Anavel\Crud\Contracts\Abstractor\RelationFactory', function () { |
|
| 66 | + $this->app->bind('Anavel\Crud\Contracts\Abstractor\RelationFactory', function() { |
|
| 67 | 67 | return new RelationAbstractorFactory( |
| 68 | 68 | $this->app['ANavallaSuiza\Laravel\Database\Contracts\Manager\ModelManager'], |
| 69 | 69 | $this->app['Anavel\Crud\Contracts\Abstractor\FieldFactory'] |
| 70 | 70 | ); |
| 71 | 71 | }); |
| 72 | 72 | |
| 73 | - $this->app->bind('Anavel\Crud\Contracts\Abstractor\ModelFactory', function () { |
|
| 73 | + $this->app->bind('Anavel\Crud\Contracts\Abstractor\ModelFactory', function() { |
|
| 74 | 74 | return new ModelAbstractorFactory( |
| 75 | 75 | config('anavel-crud.models'), |
| 76 | 76 | $this->app['ANavallaSuiza\Laravel\Database\Contracts\Manager\ModelManager'], |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | ); |
| 82 | 82 | }); |
| 83 | 83 | |
| 84 | - $this->app->bind('Anavel\Crud\Contracts\Form\Generator', function () { |
|
| 84 | + $this->app->bind('Anavel\Crud\Contracts\Form\Generator', function() { |
|
| 85 | 85 | return new FormGenerator(new FormFactory()); |
| 86 | 86 | }); |
| 87 | 87 | |