@@ -32,7 +32,7 @@ |
||
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | // If the form is not valid display a notification |
| 35 | - if (! $this->isValid()) { |
|
| 35 | + if (!$this->isValid()) { |
|
| 36 | 36 | ucnotify(uctrans('notification.form.not_valid', $module), 'error'); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | $this->registerTranslations(); |
| 28 | 28 | $this->registerPublishing(); |
| 29 | 29 | |
| 30 | - $this->loadViewsFrom(__DIR__ . '/../../resources/views', 'uccello'); |
|
| 30 | + $this->loadViewsFrom(__DIR__.'/../../resources/views', 'uccello'); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | /** |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | private function registerMigrations() |
| 39 | 39 | { |
| 40 | 40 | if ($this->app->runningInConsole()) { |
| 41 | - $this->loadMigrationsFrom(__DIR__ . '/../../database/migrations'); |
|
| 41 | + $this->loadMigrationsFrom(__DIR__.'/../../database/migrations'); |
|
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | private function registerTranslations() |
| 51 | 51 | { |
| 52 | - $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'uccello'); |
|
| 52 | + $this->loadTranslationsFrom(__DIR__.'/../../resources/lang', 'uccello'); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |
@@ -62,18 +62,18 @@ discard block |
||
| 62 | 62 | if ($this->app->runningInConsole()) { |
| 63 | 63 | // Publish assets |
| 64 | 64 | $this->publishes([ |
| 65 | - __DIR__ . '/../../public' => public_path('vendor/uccello/uccello'), |
|
| 66 | - __DIR__ . '/../../public/images/vendor' => public_path('images/vendor') |
|
| 65 | + __DIR__.'/../../public' => public_path('vendor/uccello/uccello'), |
|
| 66 | + __DIR__.'/../../public/images/vendor' => public_path('images/vendor') |
|
| 67 | 67 | ], 'uccello-assets'); |
| 68 | 68 | |
| 69 | 69 | // Config |
| 70 | 70 | $this->publishes([ |
| 71 | - __DIR__ . '/../../config/uccello.php' => config_path('uccello.php'), |
|
| 71 | + __DIR__.'/../../config/uccello.php' => config_path('uccello.php'), |
|
| 72 | 72 | ], 'uccello-config'); |
| 73 | 73 | |
| 74 | 74 | // Views |
| 75 | 75 | $this->publishes([ |
| 76 | - __DIR__ . '/../../resources/views' => resource_path('views/vendor/uccello') |
|
| 76 | + __DIR__.'/../../resources/views' => resource_path('views/vendor/uccello') |
|
| 77 | 77 | ], 'uccello-views'); |
| 78 | 78 | } |
| 79 | 79 | } |
@@ -98,12 +98,12 @@ discard block |
||
| 98 | 98 | { |
| 99 | 99 | // Config |
| 100 | 100 | $this->mergeConfigFrom( |
| 101 | - __DIR__ . '/../../config/uccello.php', |
|
| 101 | + __DIR__.'/../../config/uccello.php', |
|
| 102 | 102 | 'uccello' |
| 103 | 103 | ); |
| 104 | 104 | |
| 105 | 105 | // Helper |
| 106 | - App::bind('uccello', function () { |
|
| 106 | + App::bind('uccello', function() { |
|
| 107 | 107 | return new \Uccello\Core\Helpers\Uccello; |
| 108 | 108 | }); |
| 109 | 109 | |
@@ -83,7 +83,7 @@ |
||
| 83 | 83 | * @param mixed $message |
| 84 | 84 | * @return void |
| 85 | 85 | */ |
| 86 | - function uclog($message, $type='info') |
|
| 86 | + function uclog($message, $type = 'info') |
|
| 87 | 87 | { |
| 88 | 88 | Log::$type($message); |
| 89 | 89 | } |
@@ -55,13 +55,13 @@ |
||
| 55 | 55 | public function handle() |
| 56 | 56 | { |
| 57 | 57 | $this->comment('Executing make:auth...'); |
| 58 | - $this->callSilent('make:auth', ['--force' => true]); |
|
| 58 | + $this->callSilent('make:auth', [ '--force' => true ]); |
|
| 59 | 59 | |
| 60 | 60 | $this->comment('Publishing Uccello Assets...'); |
| 61 | - $this->callSilent('vendor:publish', ['--tag' => 'uccello-assets']); |
|
| 61 | + $this->callSilent('vendor:publish', [ '--tag' => 'uccello-assets' ]); |
|
| 62 | 62 | |
| 63 | 63 | $this->comment('Publishing Uccello Configuration...'); |
| 64 | - $this->callSilent('vendor:publish', ['--tag' => 'uccello-config']); |
|
| 64 | + $this->callSilent('vendor:publish', [ '--tag' => 'uccello-config' ]); |
|
| 65 | 65 | |
| 66 | 66 | |
| 67 | 67 | $this->comment('Copying User Model...'); |
@@ -120,8 +120,8 @@ |
||
| 120 | 120 | */ |
| 121 | 121 | public function addConditionToSearchQuery(Builder $query, Field $field, $value) : Builder |
| 122 | 122 | { |
| 123 | - $query->where(function ($query) use($field, $value) { |
|
| 124 | - foreach ((array) $value as $_value) { |
|
| 123 | + $query->where(function($query) use($field, $value) { |
|
| 124 | + foreach ((array)$value as $_value) { |
|
| 125 | 125 | // Replace me by connected user's id |
| 126 | 126 | if ($_value === 'me') { |
| 127 | 127 | $_value = auth()->id(); |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | ]; |
| 57 | 57 | |
| 58 | 58 | // We want the field displays the datetime in the good format |
| 59 | - $options['value'] = $this->getFormattedValueToDisplay($field, $record); |
|
| 59 | + $options[ 'value' ] = $this->getFormattedValueToDisplay($field, $record); |
|
| 60 | 60 | |
| 61 | 61 | return $options; |
| 62 | 62 | } |
@@ -105,10 +105,10 @@ discard block |
||
| 105 | 105 | */ |
| 106 | 106 | public function addConditionToSearchQuery(Builder $query, Field $field, $value) : Builder |
| 107 | 107 | { |
| 108 | - $query->where(function ($query) use($field, $value) { |
|
| 108 | + $query->where(function($query) use($field, $value) { |
|
| 109 | 109 | $values = explode(',', $value); // Start Date, End Date |
| 110 | - $dateStart = \Carbon\Carbon::createFromFormat(config('uccello.format.php.datetime'), trim($values[0])); |
|
| 111 | - $dateEnd = \Carbon\Carbon::createFromFormat(config('uccello.format.php.datetime'), trim($values[1])); |
|
| 110 | + $dateStart = \Carbon\Carbon::createFromFormat(config('uccello.format.php.datetime'), trim($values[ 0 ])); |
|
| 111 | + $dateEnd = \Carbon\Carbon::createFromFormat(config('uccello.format.php.datetime'), trim($values[ 1 ])); |
|
| 112 | 112 | $query->whereBetween($field->column, [ $dateStart, $dateEnd ])->get(); |
| 113 | 113 | }); |
| 114 | 114 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | ]; |
| 44 | 44 | |
| 45 | 45 | // We want the field displays the date in the good format |
| 46 | - $options['value'] = $this->getFormattedValueToDisplay($field, $record); |
|
| 46 | + $options[ 'value' ] = $this->getFormattedValueToDisplay($field, $record); |
|
| 47 | 47 | |
| 48 | 48 | return $options; |
| 49 | 49 | } |
@@ -92,10 +92,10 @@ discard block |
||
| 92 | 92 | */ |
| 93 | 93 | public function addConditionToSearchQuery(Builder $query, Field $field, $value) : Builder |
| 94 | 94 | { |
| 95 | - $query->where(function ($query) use($field, $value) { |
|
| 95 | + $query->where(function($query) use($field, $value) { |
|
| 96 | 96 | $values = explode(',', $value); // Start Date, End Date |
| 97 | - $dateStart = \Carbon\Carbon::createFromFormat(config('uccello.format.php.date'), trim($values[0])); |
|
| 98 | - $dateEnd = \Carbon\Carbon::createFromFormat(config('uccello.format.php.date'), trim($values[1])); |
|
| 97 | + $dateStart = \Carbon\Carbon::createFromFormat(config('uccello.format.php.date'), trim($values[ 0 ])); |
|
| 98 | + $dateEnd = \Carbon\Carbon::createFromFormat(config('uccello.format.php.date'), trim($values[ 1 ])); |
|
| 99 | 99 | $query->whereBetween($field->column, [ $dateStart, $dateEnd ])->get(); |
| 100 | 100 | }); |
| 101 | 101 | |
@@ -270,13 +270,13 @@ |
||
| 270 | 270 | $domain = $this->domain; |
| 271 | 271 | $module = $this->module; |
| 272 | 272 | |
| 273 | - // Get model model class |
|
| 274 | - $modelClass = $module->model_class; |
|
| 273 | + // Get model model class |
|
| 274 | + $modelClass = $module->model_class; |
|
| 275 | 275 | |
| 276 | - // Check if the class exists |
|
| 277 | - if (!class_exists($modelClass)) { |
|
| 278 | - return false; |
|
| 279 | - } |
|
| 276 | + // Check if the class exists |
|
| 277 | + if (!class_exists($modelClass)) { |
|
| 278 | + return false; |
|
| 279 | + } |
|
| 280 | 280 | |
| 281 | 281 | // Filter on domain if column exists |
| 282 | 282 | if (Schema::hasColumn((new $modelClass)->getTable(), 'domain_id')) { |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | ->get(); |
| 52 | 52 | |
| 53 | 53 | // Order by |
| 54 | - $filterOrderBy = (array) $selectedFilter->order_by; |
|
| 54 | + $filterOrderBy = (array)$selectedFilter->order_by; |
|
| 55 | 55 | |
| 56 | 56 | return $this->autoView(compact('datatableColumns', 'filters', 'selectedFilter', 'filterOrderBy')); |
| 57 | 57 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | if ($relatedList && $relatedList->method) { |
| 116 | 116 | // Related list method |
| 117 | 117 | $method = $relatedList->method; |
| 118 | - $recordIdsMethod = $method . 'RecordIds'; |
|
| 118 | + $recordIdsMethod = $method.'RecordIds'; |
|
| 119 | 119 | |
| 120 | 120 | // Get related records ids |
| 121 | 121 | $model = new $modelClass; |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | // Add the record id itself to be filtered |
| 125 | 125 | if ($relatedList->related_module_id === $module->id && !empty($recordId) && !$filteredRecordIds->contains($recordId)) { |
| 126 | - $filteredRecordIds[] = (int)$recordId; |
|
| 126 | + $filteredRecordIds[ ] = (int)$recordId; |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | // Make the quer |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | $records = $query->paginate($length); |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | - $records->getCollection()->transform(function ($record) use ($domain, $module) { |
|
| 137 | + $records->getCollection()->transform(function($record) use ($domain, $module) { |
|
| 138 | 138 | foreach ($module->fields as $field) { |
| 139 | 139 | // If a special template exists, use it. Else use the generic template |
| 140 | 140 | $uitype = uitype($field->uitype_id); |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | $results = collect(); |
| 175 | 175 | if (method_exists($modelClass, 'getSearchResult') && property_exists($modelClass, 'searchableColumns')) { |
| 176 | 176 | $searchResults = new Search(); |
| 177 | - $searchResults->registerModel($modelClass, (array) (new $modelClass)->searchableColumns); |
|
| 177 | + $searchResults->registerModel($modelClass, (array)(new $modelClass)->searchableColumns); |
|
| 178 | 178 | $results = $searchResults->search($q)->take(config('uccello.max_results.autocomplete', 10)); |
| 179 | 179 | } |
| 180 | 180 | |
@@ -195,9 +195,9 @@ discard block |
||
| 195 | 195 | $savePageLength = $request->input('save_page_length'); |
| 196 | 196 | |
| 197 | 197 | // Optional data |
| 198 | - $data = []; |
|
| 198 | + $data = [ ]; |
|
| 199 | 199 | if ($savePageLength) { |
| 200 | - $data["length"] = $request->input('page_length'); |
|
| 200 | + $data[ "length" ] = $request->input('page_length'); |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | $filter = Filter::firstOrNew([ |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create($this->tablePrefix.'entities', function (Blueprint $table) { |
|
| 16 | + Schema::create($this->tablePrefix.'entities', function(Blueprint $table) { |
|
| 17 | 17 | $table->uuid('id')->primary(); |
| 18 | 18 | $table->unsignedInteger('module_id'); |
| 19 | 19 | $table->unsignedInteger('record_id'); |