We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | private function services() |
| 24 | 24 | { |
| 25 | - $this->crud->addField([ // CustomHTML |
|
| 25 | + $this->crud->addField([// CustomHTML |
|
| 26 | 26 | 'name' => 'metas_separator', |
| 27 | 27 | 'type' => 'custom_html', |
| 28 | 28 | 'value' => '<br><h2>Metas</h2><hr>', |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | 'fake' => true, |
| 47 | 47 | 'store_in' => 'extras', |
| 48 | 48 | ]); |
| 49 | - $this->crud->addField([ // CustomHTML |
|
| 49 | + $this->crud->addField([// CustomHTML |
|
| 50 | 50 | 'name' => 'content_separator', |
| 51 | 51 | 'type' => 'custom_html', |
| 52 | 52 | 'value' => '<br><h2>Content</h2><hr>', |
@@ -44,12 +44,12 @@ discard block |
||
| 44 | 44 | ->options([0 => 'Yes', 1 => 'No']) |
| 45 | 45 | ->wrapper([ |
| 46 | 46 | 'element' => 'span', |
| 47 | - 'class' => static function ($crud, $column, $entry) { |
|
| 47 | + 'class' => static function($crud, $column, $entry) { |
|
| 48 | 48 | return 'badge badge-'.($entry->{$column['name']} ? 'default' : 'success'); |
| 49 | 49 | }, |
| 50 | 50 | ]); |
| 51 | 51 | CRUD::column('checkbox')->key('check')->label('Agreed')->type('check'); |
| 52 | - CRUD::column('created_at')->type('closure')->label('Created At')->function(function ($entry) { |
|
| 52 | + CRUD::column('created_at')->type('closure')->label('Created At')->function(function($entry) { |
|
| 53 | 53 | return 'Created on '.$entry->created_at; |
| 54 | 54 | }); |
| 55 | 55 | CRUD::column('date')->type('date'); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | ->type('model_function') |
| 62 | 62 | ->label('Text and Email') |
| 63 | 63 | ->function_name('getTextAndEmailAttribute') |
| 64 | - ->searchLogic(function ($query, $column, $searchTerm) { |
|
| 64 | + ->searchLogic(function($query, $column, $searchTerm) { |
|
| 65 | 65 | $query->orWhere('email', 'like', '%'.$searchTerm.'%'); |
| 66 | 66 | $query->orWhere('text', 'like', '%'.$searchTerm.'%'); |
| 67 | 67 | }); |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | ->attribute('name') |
| 76 | 76 | ->model("Backpack\NewsCRUD\app\Models\Category") |
| 77 | 77 | ->wrapper([ |
| 78 | - 'href' => function ($crud, $column, $entry, $related_key) { |
|
| 78 | + 'href' => function($crud, $column, $entry, $related_key) { |
|
| 79 | 79 | return backpack_url('category/'.$related_key.'/show'); |
| 80 | 80 | }, |
| 81 | 81 | ]); |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | ->attribute('name') |
| 91 | 91 | ->model('Backpack\NewsCRUD\app\Models\Tag') |
| 92 | 92 | ->wrapper([ |
| 93 | - 'href' => function ($crud, $column, $entry, $related_key) { |
|
| 93 | + 'href' => function($crud, $column, $entry, $related_key) { |
|
| 94 | 94 | return backpack_url('tag/'.$related_key.'/show'); |
| 95 | 95 | }, |
| 96 | 96 | ]); |
@@ -537,7 +537,7 @@ discard block |
||
| 537 | 537 | CRUD::filter('checkbox') |
| 538 | 538 | ->type('simple') |
| 539 | 539 | ->label('Simple') |
| 540 | - ->whenActive(function () { |
|
| 540 | + ->whenActive(function() { |
|
| 541 | 541 | CRUD::addClause('where', 'checkbox', '1'); |
| 542 | 542 | }); |
| 543 | 543 | |
@@ -545,14 +545,14 @@ discard block |
||
| 545 | 545 | ->type('dropdown') |
| 546 | 546 | ->label('Dropdown') |
| 547 | 547 | ->values(['one' => 'One', 'two' => 'Two', 'three' => 'Three']) |
| 548 | - ->whenActive(function ($value) { |
|
| 548 | + ->whenActive(function($value) { |
|
| 549 | 549 | CRUD::addClause('where', 'select_from_array', $value); |
| 550 | 550 | }); |
| 551 | 551 | |
| 552 | 552 | CRUD::filter('text') |
| 553 | 553 | ->type('text') |
| 554 | 554 | ->label('Text') |
| 555 | - ->whenActive(function ($value) { |
|
| 555 | + ->whenActive(function($value) { |
|
| 556 | 556 | CRUD::addClause('where', 'text', 'LIKE', "%$value%"); |
| 557 | 557 | }); |
| 558 | 558 | |
@@ -561,7 +561,7 @@ discard block |
||
| 561 | 561 | ->label('Range') |
| 562 | 562 | ->label_from('min value') |
| 563 | 563 | ->label_to('max value') |
| 564 | - ->whenActive(function ($value) { |
|
| 564 | + ->whenActive(function($value) { |
|
| 565 | 565 | $range = json_decode($value); |
| 566 | 566 | if ($range->from && $range->to) { |
| 567 | 567 | CRUD::addClause('where', 'number', '>=', (float) $range->from); |
@@ -572,14 +572,14 @@ discard block |
||
| 572 | 572 | CRUD::filter('date') |
| 573 | 573 | ->type('date') |
| 574 | 574 | ->label('Date') |
| 575 | - ->whenActive(function ($value) { |
|
| 575 | + ->whenActive(function($value) { |
|
| 576 | 576 | CRUD::addClause('where', 'date', '=', $value); |
| 577 | 577 | }); |
| 578 | 578 | |
| 579 | 579 | CRUD::filter('date_range') |
| 580 | 580 | ->type('date_range') |
| 581 | 581 | ->label('Date range') |
| 582 | - ->whenActive(function ($value) { |
|
| 582 | + ->whenActive(function($value) { |
|
| 583 | 583 | $dates = json_decode($value); |
| 584 | 584 | CRUD::addClause('where', 'date', '>=', $dates->from); |
| 585 | 585 | CRUD::addClause('where', 'date', '<=', $dates->to); |
@@ -588,18 +588,18 @@ discard block |
||
| 588 | 588 | CRUD::filter('select2') |
| 589 | 589 | ->type('select2') |
| 590 | 590 | ->label('Select2') |
| 591 | - ->values(function () { |
|
| 591 | + ->values(function() { |
|
| 592 | 592 | return \Backpack\NewsCRUD\app\Models\Category::all()->keyBy('id')->pluck('name', 'id')->toArray(); |
| 593 | - })->whenActive(function ($value) { |
|
| 593 | + })->whenActive(function($value) { |
|
| 594 | 594 | CRUD::addClause('where', 'select2', $value); |
| 595 | 595 | }); |
| 596 | 596 | |
| 597 | 597 | CRUD::filter('select2_multiple') |
| 598 | 598 | ->type('select2_multiple') |
| 599 | 599 | ->label('S2 multiple') |
| 600 | - ->values(function () { |
|
| 600 | + ->values(function() { |
|
| 601 | 601 | return \Backpack\NewsCRUD\app\Models\Category::all()->keyBy('id')->pluck('name', 'id')->toArray(); |
| 602 | - })->whenActive(function ($values) { |
|
| 602 | + })->whenActive(function($values) { |
|
| 603 | 603 | foreach (json_decode($values) as $key => $value) { |
| 604 | 604 | CRUD::addClause('orWhere', 'select2', $value); |
| 605 | 605 | } |
@@ -610,7 +610,7 @@ discard block |
||
| 610 | 610 | ->label('S2 Ajax') |
| 611 | 611 | ->placeholder('Pick an article') |
| 612 | 612 | ->values(url('api/article-search')) |
| 613 | - ->whenActive(function ($value) { |
|
| 613 | + ->whenActive(function($value) { |
|
| 614 | 614 | CRUD::addClause('where', 'select2_from_ajax', $value); |
| 615 | 615 | }); |
| 616 | 616 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | { |
| 52 | 52 | CRUD::setValidation(StoreRequest::class); |
| 53 | 53 | |
| 54 | - CRUD::addField([ // Text |
|
| 54 | + CRUD::addField([// Text |
|
| 55 | 55 | 'name' => 'name', |
| 56 | 56 | 'label' => 'Name', |
| 57 | 57 | 'type' => 'text', |
@@ -72,21 +72,21 @@ discard block |
||
| 72 | 72 | //'readonly'=>'readonly', |
| 73 | 73 | ]); |
| 74 | 74 | |
| 75 | - CRUD::addField([ // Textarea |
|
| 75 | + CRUD::addField([// Textarea |
|
| 76 | 76 | 'name' => 'description', |
| 77 | 77 | 'label' => 'Description', |
| 78 | 78 | 'type' => 'textarea', |
| 79 | 79 | 'tab' => 'Texts', |
| 80 | 80 | ]); |
| 81 | 81 | |
| 82 | - CRUD::addField([ // Wysiwyg |
|
| 82 | + CRUD::addField([// Wysiwyg |
|
| 83 | 83 | 'name' => 'details', |
| 84 | 84 | 'label' => 'Details', |
| 85 | 85 | 'type' => 'wysiwyg', |
| 86 | 86 | 'tab' => 'Texts', |
| 87 | 87 | ]); |
| 88 | 88 | |
| 89 | - CRUD::addField([ // Table |
|
| 89 | + CRUD::addField([// Table |
|
| 90 | 90 | 'name' => 'features', |
| 91 | 91 | 'label' => 'Features', |
| 92 | 92 | 'type' => 'table', |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | 'tab' => 'Texts', |
| 101 | 101 | ]); |
| 102 | 102 | |
| 103 | - CRUD::addField([ // Table |
|
| 103 | + CRUD::addField([// Table |
|
| 104 | 104 | 'name' => 'extra_features', |
| 105 | 105 | 'label' => 'Extra Features', |
| 106 | 106 | 'type' => 'table', |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | 'tab' => 'Texts', |
| 116 | 116 | ]); |
| 117 | 117 | |
| 118 | - CRUD::addField([ // Select2 |
|
| 118 | + CRUD::addField([// Select2 |
|
| 119 | 119 | 'label' => 'Category', |
| 120 | 120 | 'type' => 'select2', |
| 121 | 121 | 'name' => 'category_id', // the db column for the foreign key |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | 'tab' => 'Basic Info', |
| 128 | 128 | ]); |
| 129 | 129 | |
| 130 | - CRUD::addField([ // Number |
|
| 130 | + CRUD::addField([// Number |
|
| 131 | 131 | 'name' => 'price', |
| 132 | 132 | 'label' => 'Price', |
| 133 | 133 | 'type' => 'number', |
@@ -142,21 +142,21 @@ discard block |
||
| 142 | 142 | ]); |
| 143 | 143 | |
| 144 | 144 | CRUD::addFields([ |
| 145 | - [ // Text |
|
| 145 | + [// Text |
|
| 146 | 146 | 'name' => 'meta_title', |
| 147 | 147 | 'label' => 'Meta Title', |
| 148 | 148 | 'type' => 'text', |
| 149 | 149 | 'fake' => true, |
| 150 | 150 | 'tab' => 'Metas', |
| 151 | 151 | ], |
| 152 | - [ // Text |
|
| 152 | + [// Text |
|
| 153 | 153 | 'name' => 'meta_description', |
| 154 | 154 | 'label' => 'Meta Description', |
| 155 | 155 | 'type' => 'text', |
| 156 | 156 | 'fake' => true, |
| 157 | 157 | 'tab' => 'Metas', |
| 158 | 158 | ], |
| 159 | - [ // Text |
|
| 159 | + [// Text |
|
| 160 | 160 | 'name' => 'meta_keywords', |
| 161 | 161 | 'label' => 'Meta Keywords', |
| 162 | 162 | 'type' => 'text', |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | return [ |
| 29 | 29 | 'name' => 'required|min:5|max:255', |
| 30 | 30 | 'description' => 'required', |
| 31 | - 'simple' => function ($attribute, $value, $fail) { |
|
| 31 | + 'simple' => function($attribute, $value, $fail) { |
|
| 32 | 32 | $fieldGroups = json_decode($value); |
| 33 | 33 | |
| 34 | 34 | // do not allow repeatable field to be empty |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | Route::group([ |
| 55 | 55 | 'middleware' => 'web', |
| 56 | 56 | 'namespace' => $this->namespace, |
| 57 | - ], function ($router) { |
|
| 57 | + ], function($router) { |
|
| 58 | 58 | require base_path('routes/web.php'); |
| 59 | 59 | }); |
| 60 | 60 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | 'middleware' => 'api', |
| 73 | 73 | 'namespace' => $this->namespace, |
| 74 | 74 | 'prefix' => 'api', |
| 75 | - ], function ($router) { |
|
| 75 | + ], function($router) { |
|
| 76 | 76 | require base_path('routes/api.php'); |
| 77 | 77 | }); |
| 78 | 78 | } |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | /* |
| 20 | 20 | * Authenticate the user's personal channel... |
| 21 | 21 | */ |
| 22 | - Broadcast::channel('App.User.*', function ($user, $userId) { |
|
| 22 | + Broadcast::channel('App.User.*', function($user, $userId) { |
|
| 23 | 23 | return (int) $user->id === (int) $userId; |
| 24 | 24 | }); |
| 25 | 25 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | 'options' => [0 => 'Yes', 1 => 'No'], |
| 64 | 64 | 'wrapper' => [ |
| 65 | 65 | 'element' => 'span', |
| 66 | - 'class' => function ($crud, $column, $entry, $related_key) { |
|
| 66 | + 'class' => function($crud, $column, $entry, $related_key) { |
|
| 67 | 67 | if ($column['text'] == 'Yes') { |
| 68 | 68 | return 'badge badge-success'; |
| 69 | 69 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | 'name' => 'created_at', |
| 83 | 83 | 'label' => 'Created At', |
| 84 | 84 | 'type' => 'closure', |
| 85 | - 'function' => function ($entry) { |
|
| 85 | + 'function' => function($entry) { |
|
| 86 | 86 | return 'Created on '.$entry->created_at; |
| 87 | 87 | }, |
| 88 | 88 | ], |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | 'label' => 'Text and Email', // Table column heading |
| 109 | 109 | 'type' => 'model_function', |
| 110 | 110 | 'function_name' => 'getTextAndEmailAttribute', // the method in your Model |
| 111 | - 'searchLogic' => function ($query, $column, $searchTerm) { |
|
| 111 | + 'searchLogic' => function($query, $column, $searchTerm) { |
|
| 112 | 112 | $query->orWhere('email', 'like', '%'.$searchTerm.'%'); |
| 113 | 113 | $query->orWhere('text', 'like', '%'.$searchTerm.'%'); |
| 114 | 114 | }, |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | 'type' => 'radio', |
| 126 | 126 | 'options' => [0 => 'Draft', 1 => 'Published', 2 => 'Other'], |
| 127 | 127 | ], |
| 128 | - [ // 1-n relationship |
|
| 128 | + [// 1-n relationship |
|
| 129 | 129 | 'label' => 'Select', // Table column heading |
| 130 | 130 | 'type' => 'select', |
| 131 | 131 | 'name' => 'select', // the column that contains the ID of that connected entity; |
@@ -133,18 +133,18 @@ discard block |
||
| 133 | 133 | 'attribute' => 'name', // foreign key attribute that is shown to user |
| 134 | 134 | 'model' => "Backpack\NewsCRUD\app\Models\Category", // foreign key model |
| 135 | 135 | 'wrapper' => [ |
| 136 | - 'href' => function ($crud, $column, $entry, $related_key) { |
|
| 136 | + 'href' => function($crud, $column, $entry, $related_key) { |
|
| 137 | 137 | return backpack_url('category/'.$related_key.'/show'); |
| 138 | 138 | }, |
| 139 | 139 | ], |
| 140 | 140 | ], |
| 141 | - [ // select_from_array |
|
| 141 | + [// select_from_array |
|
| 142 | 142 | 'name' => 'select_from_array', |
| 143 | 143 | 'label' => 'Select_from_array', |
| 144 | 144 | 'type' => 'select_from_array', |
| 145 | 145 | 'options' => ['one' => 'One', 'two' => 'Two', 'three' => 'Three'], |
| 146 | 146 | ], |
| 147 | - [ // select_multiple: n-n relationship (with pivot table) |
|
| 147 | + [// select_multiple: n-n relationship (with pivot table) |
|
| 148 | 148 | 'label' => 'Select_multiple', // Table column heading |
| 149 | 149 | 'type' => 'select_multiple', |
| 150 | 150 | 'name' => 'tags', // the method that defines the relationship in your Model |
@@ -152,18 +152,18 @@ discard block |
||
| 152 | 152 | 'attribute' => 'name', // foreign key attribute that is shown to user |
| 153 | 153 | 'model' => "Backpack\NewsCRUD\app\Models\Tag", // foreign key model |
| 154 | 154 | 'wrapper' => [ |
| 155 | - 'href' => function ($crud, $column, $entry, $related_key) { |
|
| 155 | + 'href' => function($crud, $column, $entry, $related_key) { |
|
| 156 | 156 | return backpack_url('tag/'.$related_key.'/show'); |
| 157 | 157 | }, |
| 158 | 158 | ], |
| 159 | 159 | ], |
| 160 | - [ // select_multiple: n-n relationship (with pivot table) |
|
| 160 | + [// select_multiple: n-n relationship (with pivot table) |
|
| 161 | 161 | 'label' => 'Relationship_count', // Table column heading |
| 162 | 162 | 'type' => 'relationship_count', |
| 163 | 163 | 'name' => 'categories', // the method that defines the relationship in your Model |
| 164 | 164 | 'entity' => 'categories', // the method that defines the relationship in your Model |
| 165 | 165 | 'wrapper' => [ |
| 166 | - 'href' => function ($crud, $column, $entry, $related_key) { |
|
| 166 | + 'href' => function($crud, $column, $entry, $related_key) { |
|
| 167 | 167 | return backpack_url('category'); |
| 168 | 168 | }, |
| 169 | 169 | ], |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | $this->crud->set('show.contentClass', 'col-md-12'); |
| 191 | 191 | |
| 192 | - $this->crud->addColumn([ // SimpleMDE |
|
| 192 | + $this->crud->addColumn([// SimpleMDE |
|
| 193 | 193 | 'name' => 'simplemde', |
| 194 | 194 | 'label' => 'Markdown (SimpleMDE)', |
| 195 | 195 | 'type' => 'markdown', |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | 'type' => 'phone', |
| 238 | 238 | ]); |
| 239 | 239 | |
| 240 | - $this->crud->addColumn([ // Upload |
|
| 240 | + $this->crud->addColumn([// Upload |
|
| 241 | 241 | 'name' => 'upload_multiple', |
| 242 | 242 | 'label' => 'Upload Multiple', |
| 243 | 243 | 'type' => 'upload_multiple', |
@@ -269,34 +269,34 @@ discard block |
||
| 269 | 269 | protected function addCustomCrudFilters() |
| 270 | 270 | { |
| 271 | 271 | $this->crud->addFilter( |
| 272 | - [ // add a "simple" filter called Draft |
|
| 272 | + [// add a "simple" filter called Draft |
|
| 273 | 273 | 'type' => 'simple', |
| 274 | 274 | 'name' => 'checkbox', |
| 275 | 275 | 'label' => 'Simple', |
| 276 | 276 | ], |
| 277 | 277 | false, // the simple filter has no values, just the "Draft" label specified above |
| 278 | - function () { // if the filter is active (the GET parameter "draft" exits) |
|
| 278 | + function() { // if the filter is active (the GET parameter "draft" exits) |
|
| 279 | 279 | $this->crud->addClause('where', 'checkbox', '1'); |
| 280 | 280 | } |
| 281 | 281 | ); |
| 282 | 282 | |
| 283 | - $this->crud->addFilter([ // dropdown filter |
|
| 283 | + $this->crud->addFilter([// dropdown filter |
|
| 284 | 284 | 'name' => 'select_from_array', |
| 285 | 285 | 'type' => 'dropdown', |
| 286 | 286 | 'label'=> 'Dropdown', |
| 287 | - ], ['one' => 'One', 'two' => 'Two', 'three' => 'Three'], function ($value) { |
|
| 287 | + ], ['one' => 'One', 'two' => 'Two', 'three' => 'Three'], function($value) { |
|
| 288 | 288 | // if the filter is active |
| 289 | 289 | $this->crud->addClause('where', 'select_from_array', $value); |
| 290 | 290 | }); |
| 291 | 291 | |
| 292 | 292 | $this->crud->addFilter( |
| 293 | - [ // text filter |
|
| 293 | + [// text filter |
|
| 294 | 294 | 'type' => 'text', |
| 295 | 295 | 'name' => 'text', |
| 296 | 296 | 'label' => 'Text', |
| 297 | 297 | ], |
| 298 | 298 | false, |
| 299 | - function ($value) { // if the filter is active |
|
| 299 | + function($value) { // if the filter is active |
|
| 300 | 300 | $this->crud->addClause('where', 'text', 'LIKE', "%$value%"); |
| 301 | 301 | } |
| 302 | 302 | ); |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | 'label_to' => 'max value', |
| 311 | 311 | ], |
| 312 | 312 | false, |
| 313 | - function ($value) { // if the filter is active |
|
| 313 | + function($value) { // if the filter is active |
|
| 314 | 314 | $range = json_decode($value); |
| 315 | 315 | if ($range->from && $range->to) { |
| 316 | 316 | $this->crud->addClause('where', 'number', '>=', (float) $range->from); |
@@ -320,19 +320,19 @@ discard block |
||
| 320 | 320 | ); |
| 321 | 321 | |
| 322 | 322 | $this->crud->addFilter( |
| 323 | - [ // date filter |
|
| 323 | + [// date filter |
|
| 324 | 324 | 'type' => 'date', |
| 325 | 325 | 'name' => 'date', |
| 326 | 326 | 'label' => 'Date', |
| 327 | 327 | ], |
| 328 | 328 | false, |
| 329 | - function ($value) { // if the filter is active, apply these constraints |
|
| 329 | + function($value) { // if the filter is active, apply these constraints |
|
| 330 | 330 | $this->crud->addClause('where', 'date', '=', $value); |
| 331 | 331 | } |
| 332 | 332 | ); |
| 333 | 333 | |
| 334 | 334 | $this->crud->addFilter( |
| 335 | - [ // daterange filter |
|
| 335 | + [// daterange filter |
|
| 336 | 336 | 'type' => 'date_range', |
| 337 | 337 | 'name' => 'date_range', |
| 338 | 338 | 'label'=> 'Date range', |
@@ -344,44 +344,44 @@ discard block |
||
| 344 | 344 | // ] |
| 345 | 345 | ], |
| 346 | 346 | false, |
| 347 | - function ($value) { // if the filter is active, apply these constraints |
|
| 347 | + function($value) { // if the filter is active, apply these constraints |
|
| 348 | 348 | $dates = json_decode($value); |
| 349 | 349 | $this->crud->addClause('where', 'date', '>=', $dates->from); |
| 350 | 350 | $this->crud->addClause('where', 'date', '<=', $dates->to); |
| 351 | 351 | } |
| 352 | 352 | ); |
| 353 | 353 | |
| 354 | - $this->crud->addFilter([ // select2 filter |
|
| 354 | + $this->crud->addFilter([// select2 filter |
|
| 355 | 355 | 'name' => 'select2', |
| 356 | 356 | 'type' => 'select2', |
| 357 | 357 | 'label'=> 'Select2', |
| 358 | - ], function () { |
|
| 358 | + ], function() { |
|
| 359 | 359 | return \Backpack\NewsCRUD\app\Models\Category::all()->keyBy('id')->pluck('name', 'id')->toArray(); |
| 360 | - }, function ($value) { // if the filter is active |
|
| 360 | + }, function($value) { // if the filter is active |
|
| 361 | 361 | $this->crud->addClause('where', 'select2', $value); |
| 362 | 362 | }); |
| 363 | 363 | |
| 364 | - $this->crud->addFilter([ // select2_multiple filter |
|
| 364 | + $this->crud->addFilter([// select2_multiple filter |
|
| 365 | 365 | 'name' => 'select2_multiple', |
| 366 | 366 | 'type' => 'select2_multiple', |
| 367 | 367 | 'label'=> 'S2 multiple', |
| 368 | - ], function () { |
|
| 368 | + ], function() { |
|
| 369 | 369 | return \Backpack\NewsCRUD\app\Models\Category::all()->keyBy('id')->pluck('name', 'id')->toArray(); |
| 370 | - }, function ($values) { // if the filter is active |
|
| 370 | + }, function($values) { // if the filter is active |
|
| 371 | 371 | foreach (json_decode($values) as $key => $value) { |
| 372 | 372 | $this->crud->addClause('orWhere', 'select2', $value); |
| 373 | 373 | } |
| 374 | 374 | }); |
| 375 | 375 | |
| 376 | 376 | $this->crud->addFilter( |
| 377 | - [ // select2_ajax filter |
|
| 377 | + [// select2_ajax filter |
|
| 378 | 378 | 'name' => 'select2_from_ajax', |
| 379 | 379 | 'type' => 'select2_ajax', |
| 380 | 380 | 'label' => 'S2 Ajax', |
| 381 | 381 | 'placeholder' => 'Pick an article', |
| 382 | 382 | ], |
| 383 | 383 | url('api/article-search'), // the ajax route |
| 384 | - function ($value) { // if the filter is active |
|
| 384 | + function($value) { // if the filter is active |
|
| 385 | 385 | $this->crud->addClause('where', 'select2_from_ajax', $value); |
| 386 | 386 | } |
| 387 | 387 | ); |
@@ -408,20 +408,20 @@ discard block |
||
| 408 | 408 | 'class' => 'form-group col-md-6', |
| 409 | 409 | ], |
| 410 | 410 | ], |
| 411 | - [ // Textarea |
|
| 411 | + [// Textarea |
|
| 412 | 412 | 'name' => 'textarea', |
| 413 | 413 | 'label' => 'Textarea', |
| 414 | 414 | 'type' => 'textarea', |
| 415 | 415 | 'tab' => 'Simple', |
| 416 | 416 | ], |
| 417 | - [ // Number |
|
| 417 | + [// Number |
|
| 418 | 418 | 'name' => 'number', |
| 419 | 419 | 'label' => 'Number', |
| 420 | 420 | 'type' => 'number', |
| 421 | 421 | 'tab' => 'Simple', |
| 422 | 422 | 'wrapperAttributes' => ['class' => 'form-group col-md-3'], |
| 423 | 423 | ], |
| 424 | - [ // Number |
|
| 424 | + [// Number |
|
| 425 | 425 | 'name' => 'float', |
| 426 | 426 | 'label' => 'Float', |
| 427 | 427 | 'type' => 'number', |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | 'tab' => 'Simple', |
| 430 | 430 | 'wrapperAttributes' => ['class' => 'form-group col-md-3'], |
| 431 | 431 | ], |
| 432 | - [ // Number |
|
| 432 | + [// Number |
|
| 433 | 433 | 'name' => 'number_with_prefix', |
| 434 | 434 | 'label' => 'Number with prefix', |
| 435 | 435 | 'type' => 'number', |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | 'tab' => 'Simple', |
| 440 | 440 | 'wrapperAttributes' => ['class' => 'form-group col-md-3'], |
| 441 | 441 | ], |
| 442 | - [ // Number |
|
| 442 | + [// Number |
|
| 443 | 443 | 'name' => 'number_with_suffix', |
| 444 | 444 | 'label' => 'Number with suffix', |
| 445 | 445 | 'type' => 'number', |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | 'tab' => 'Simple', |
| 450 | 450 | 'wrapperAttributes' => ['class' => 'form-group col-md-3'], |
| 451 | 451 | ], |
| 452 | - [ // Number |
|
| 452 | + [// Number |
|
| 453 | 453 | 'name' => 'text_with_both_prefix_and_suffix', |
| 454 | 454 | 'label' => 'Text with both prefix and suffix', |
| 455 | 455 | 'type' => 'number', |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | 'tab' => 'Simple', |
| 461 | 461 | 'wrapperAttributes' => ['class' => 'form-group col-md-6'], |
| 462 | 462 | ], |
| 463 | - [ // Password |
|
| 463 | + [// Password |
|
| 464 | 464 | 'name' => 'password', |
| 465 | 465 | 'label' => 'Password', |
| 466 | 466 | 'type' => 'password', |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | 'name' => 'radio', // the name of the db column |
| 472 | 472 | 'label' => 'Status (radio)', // the input label |
| 473 | 473 | 'type' => 'radio', |
| 474 | - 'options' => [ // the key will be stored in the db, the value will be shown as label; |
|
| 474 | + 'options' => [// the key will be stored in the db, the value will be shown as label; |
|
| 475 | 475 | 0 => 'Draft', |
| 476 | 476 | 1 => 'Published', |
| 477 | 477 | 2 => 'Other', |
@@ -480,13 +480,13 @@ discard block |
||
| 480 | 480 | 'inline' => true, // show the radios all on the same line? |
| 481 | 481 | 'tab' => 'Simple', |
| 482 | 482 | ], |
| 483 | - [ // Checkbox |
|
| 483 | + [// Checkbox |
|
| 484 | 484 | 'name' => 'checkbox', |
| 485 | 485 | 'label' => 'I have not read the terms and conditions and I never will (checkbox)', |
| 486 | 486 | 'type' => 'checkbox', |
| 487 | 487 | 'tab' => 'Simple', |
| 488 | 488 | ], |
| 489 | - [ // Hidden |
|
| 489 | + [// Hidden |
|
| 490 | 490 | 'name' => 'hidden', |
| 491 | 491 | 'type' => 'hidden', |
| 492 | 492 | 'default' => '6318', |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | // ----------------- |
| 503 | 503 | |
| 504 | 504 | return [ |
| 505 | - [ // Time |
|
| 505 | + [// Time |
|
| 506 | 506 | 'name' => 'time', |
| 507 | 507 | 'label' => 'Time', |
| 508 | 508 | 'type' => 'time', |
@@ -510,21 +510,21 @@ discard block |
||
| 510 | 510 | 'tab' => 'Time and space', |
| 511 | 511 | 'fake' => true, |
| 512 | 512 | ], |
| 513 | - [ // Month |
|
| 513 | + [// Month |
|
| 514 | 514 | 'name' => 'week', |
| 515 | 515 | 'label' => 'Week', |
| 516 | 516 | 'type' => 'week', |
| 517 | 517 | 'wrapperAttributes' => ['class' => 'form-group col-md-4'], |
| 518 | 518 | 'tab' => 'Time and space', |
| 519 | 519 | ], |
| 520 | - [ // Month |
|
| 520 | + [// Month |
|
| 521 | 521 | 'name' => 'month', |
| 522 | 522 | 'label' => 'Month', |
| 523 | 523 | 'type' => 'month', |
| 524 | 524 | 'wrapperAttributes' => ['class' => 'form-group col-md-4'], |
| 525 | 525 | 'tab' => 'Time and space', |
| 526 | 526 | ], |
| 527 | - [ // Date |
|
| 527 | + [// Date |
|
| 528 | 528 | 'name' => 'date', |
| 529 | 529 | 'label' => 'Date (HTML5 spec)', |
| 530 | 530 | 'type' => 'date', |
@@ -535,7 +535,7 @@ discard block |
||
| 535 | 535 | 'wrapperAttributes' => ['class' => 'form-group col-md-6'], |
| 536 | 536 | 'tab' => 'Time and space', |
| 537 | 537 | ], |
| 538 | - [ // Date |
|
| 538 | + [// Date |
|
| 539 | 539 | 'name' => 'date_picker', |
| 540 | 540 | 'label' => 'Date picker (jQuery plugin)', |
| 541 | 541 | 'type' => 'date_picker', |
@@ -548,14 +548,14 @@ discard block |
||
| 548 | 548 | 'wrapperAttributes' => ['class' => 'form-group col-md-6'], |
| 549 | 549 | 'tab' => 'Time and space', |
| 550 | 550 | ], |
| 551 | - [ // DateTime |
|
| 551 | + [// DateTime |
|
| 552 | 552 | 'name' => 'datetime', |
| 553 | 553 | 'label' => 'Datetime (HTML5 spec)', |
| 554 | 554 | 'type' => 'datetime', |
| 555 | 555 | 'wrapperAttributes' => ['class' => 'form-group col-md-6'], |
| 556 | 556 | 'tab' => 'Time and space', |
| 557 | 557 | ], |
| 558 | - [ // DateTime |
|
| 558 | + [// DateTime |
|
| 559 | 559 | 'name' => 'datetime_picker', |
| 560 | 560 | 'label' => 'Datetime picker (jQuery plugin)', |
| 561 | 561 | 'type' => 'datetime_picker', |
@@ -567,19 +567,19 @@ discard block |
||
| 567 | 567 | 'wrapperAttributes' => ['class' => 'form-group col-md-6'], |
| 568 | 568 | 'tab' => 'Time and space', |
| 569 | 569 | ], |
| 570 | - [ // Date_range |
|
| 570 | + [// Date_range |
|
| 571 | 571 | 'name' => ['start_date', 'end_date'], // a unique name for this field |
| 572 | 572 | 'label' => 'Date Range', |
| 573 | 573 | 'type' => 'date_range', |
| 574 | 574 | 'default' => ['2020-03-28 01:01', '2020-04-05 02:00'], |
| 575 | 575 | // OPTIONALS |
| 576 | - 'date_range_options' => [ // options sent to daterangepicker.js |
|
| 576 | + 'date_range_options' => [// options sent to daterangepicker.js |
|
| 577 | 577 | 'timePicker' => true, |
| 578 | 578 | 'locale' => ['format' => 'DD/MM/YYYY HH:mm'], |
| 579 | 579 | ], |
| 580 | 580 | 'tab' => 'Time and space', |
| 581 | 581 | ], |
| 582 | - [ // Address |
|
| 582 | + [// Address |
|
| 583 | 583 | 'name' => 'address_algolia_string', |
| 584 | 584 | 'label' => 'Address_algolia (saved in db as string)', |
| 585 | 585 | 'type' => 'address_algolia', |
@@ -588,7 +588,7 @@ discard block |
||
| 588 | 588 | // 'store_as_json' => true, |
| 589 | 589 | 'tab' => 'Time and space', |
| 590 | 590 | ], |
| 591 | - [ // Address |
|
| 591 | + [// Address |
|
| 592 | 592 | 'name' => 'address_algolia', |
| 593 | 593 | 'label' => 'Address_algolia (stored in db as json)', |
| 594 | 594 | 'type' => 'address_algolia', |
@@ -609,13 +609,13 @@ discard block |
||
| 609 | 609 | // ----------------- |
| 610 | 610 | // n-n relationships |
| 611 | 611 | // ----------------- |
| 612 | - [ // CustomHTML |
|
| 612 | + [// CustomHTML |
|
| 613 | 613 | 'name' => 'select_n_n_heading', |
| 614 | 614 | 'type' => 'custom_html', |
| 615 | 615 | 'value' => '<h5 class="mb-0 mt-3 text-primary">n-n Relationship with Pivot Table (HasMany, BelongsToMany)</h5>', |
| 616 | 616 | 'tab' => 'Relationships', |
| 617 | 617 | ], |
| 618 | - [ // Select_Multiple = n-n relationship |
|
| 618 | + [// Select_Multiple = n-n relationship |
|
| 619 | 619 | 'label' => 'Select_multiple', |
| 620 | 620 | 'type' => 'select_multiple', |
| 621 | 621 | 'name' => 'tags', // the method that defines the relationship in your Model |
@@ -626,7 +626,7 @@ discard block |
||
| 626 | 626 | 'tab' => 'Relationships', |
| 627 | 627 | // 'wrapperAttributes' => ['class' => 'form-group col-md-12'], |
| 628 | 628 | ], |
| 629 | - [ // Select2Multiple = n-n relationship (with pivot table) |
|
| 629 | + [// Select2Multiple = n-n relationship (with pivot table) |
|
| 630 | 630 | 'label' => 'Select2_multiple', |
| 631 | 631 | 'type' => 'select2_multiple', |
| 632 | 632 | 'name' => 'categories', // the method that defines the relationship in your Model |
@@ -638,7 +638,7 @@ discard block |
||
| 638 | 638 | 'tab' => 'Relationships', |
| 639 | 639 | 'wrapperAttributes' => ['class' => 'form-group col-md-6'], |
| 640 | 640 | ], |
| 641 | - [ // Select2_from_ajax_multiple: n-n relationship with pivot table |
|
| 641 | + [// Select2_from_ajax_multiple: n-n relationship with pivot table |
|
| 642 | 642 | 'label' => 'Select2_from_ajax_multiple', // Table column heading |
| 643 | 643 | 'type' => 'select2_from_ajax_multiple', |
| 644 | 644 | 'name' => 'articles', // the column that contains the ID of that connected entity; |
@@ -652,7 +652,7 @@ discard block |
||
| 652 | 652 | 'tab' => 'Relationships', |
| 653 | 653 | 'wrapperAttributes' => ['class' => 'form-group col-md-6'], |
| 654 | 654 | ], |
| 655 | - [ // Relationship |
|
| 655 | + [// Relationship |
|
| 656 | 656 | 'label' => 'Relationship (also uses InlineCreate; Fetch using AJAX) <span class="badge badge-warning">New in 4.1</span>', |
| 657 | 657 | 'type' => 'relationship', |
| 658 | 658 | 'name' => 'products', |
@@ -682,13 +682,13 @@ discard block |
||
| 682 | 682 | // ----------------- |
| 683 | 683 | // 1-n relationships |
| 684 | 684 | // ----------------- |
| 685 | - [ // CustomHTML |
|
| 685 | + [// CustomHTML |
|
| 686 | 686 | 'name' => 'select_1_n_heading', |
| 687 | 687 | 'type' => 'custom_html', |
| 688 | 688 | 'value' => '<h5 class="mb-0 text-primary">1-n Relationships (HasOne, BelongsTo)</h5>', |
| 689 | 689 | 'tab' => 'Relationships', |
| 690 | 690 | ], |
| 691 | - [ // SELECT |
|
| 691 | + [// SELECT |
|
| 692 | 692 | 'label' => 'Select', |
| 693 | 693 | 'type' => 'select', |
| 694 | 694 | 'name' => 'select', |
@@ -698,7 +698,7 @@ discard block |
||
| 698 | 698 | 'tab' => 'Relationships', |
| 699 | 699 | 'wrapperAttributes' => ['class' => 'form-group col-md-6'], |
| 700 | 700 | ], |
| 701 | - [ // select_grouped |
|
| 701 | + [// select_grouped |
|
| 702 | 702 | 'label' => 'Select_grouped', |
| 703 | 703 | 'type' => 'select_grouped', //https://github.com/Laravel-Backpack/CRUD/issues/502 |
| 704 | 704 | 'name' => 'select_grouped_id', |
@@ -712,7 +712,7 @@ discard block |
||
| 712 | 712 | 'tab' => 'Relationships', |
| 713 | 713 | 'wrapperAttributes' => ['class' => 'form-group col-md-6'], |
| 714 | 714 | ], |
| 715 | - [ // SELECT2 |
|
| 715 | + [// SELECT2 |
|
| 716 | 716 | 'label' => 'Select2', |
| 717 | 717 | 'type' => 'select2', |
| 718 | 718 | 'name' => 'select2', |
@@ -722,7 +722,7 @@ discard block |
||
| 722 | 722 | 'tab' => 'Relationships', |
| 723 | 723 | 'wrapperAttributes' => ['class' => 'form-group col-md-4'], |
| 724 | 724 | ], |
| 725 | - [ // select2_grouped |
|
| 725 | + [// select2_grouped |
|
| 726 | 726 | 'label' => 'Select2_grouped', |
| 727 | 727 | 'type' => 'select2_grouped', //https://github.com/Laravel-Backpack/CRUD/issues/502 |
| 728 | 728 | 'name' => 'select2_grouped_id', |
@@ -736,7 +736,7 @@ discard block |
||
| 736 | 736 | 'tab' => 'Relationships', |
| 737 | 737 | 'wrapperAttributes' => ['class' => 'form-group col-md-4'], |
| 738 | 738 | ], |
| 739 | - [ // select2_nested |
|
| 739 | + [// select2_nested |
|
| 740 | 740 | 'name' => 'select2_nested_id', |
| 741 | 741 | 'label' => 'Select2_nested', |
| 742 | 742 | 'type' => 'select2_nested', |
@@ -747,7 +747,7 @@ discard block |
||
| 747 | 747 | 'tab' => 'Relationships', |
| 748 | 748 | 'wrapperAttributes' => ['class' => 'form-group col-md-4'], |
| 749 | 749 | ], |
| 750 | - [ // select2_from_ajax: 1-n relationship |
|
| 750 | + [// select2_from_ajax: 1-n relationship |
|
| 751 | 751 | 'label' => 'Select2_from_ajax', // Table column heading |
| 752 | 752 | 'type' => 'select2_from_ajax', |
| 753 | 753 | 'name' => 'select2_from_ajax', // the column that contains the ID of that connected entity; |
@@ -760,14 +760,14 @@ discard block |
||
| 760 | 760 | 'tab' => 'Relationships', |
| 761 | 761 | 'wrapperAttributes' => ['class' => 'form-group col-md-12'], |
| 762 | 762 | ], |
| 763 | - [ // Relationship - nothing is explicitly defined, not even the field type |
|
| 763 | + [// Relationship - nothing is explicitly defined, not even the field type |
|
| 764 | 764 | 'label' => 'Relationship (no AJAX, inferred attributes) <span class="badge badge-warning">New in 4.1</span>', |
| 765 | 765 | 'name' => 'icon', |
| 766 | 766 | 'tab' => 'Relationships', |
| 767 | 767 | // 'data_source' => backpack_url('monster/fetch/icon'), |
| 768 | 768 | 'wrapperAttributes' => ['class' => 'form-group col-md-6'], |
| 769 | 769 | ], |
| 770 | - [ // Relationship - everything is explicitly defined |
|
| 770 | + [// Relationship - everything is explicitly defined |
|
| 771 | 771 | 'label' => 'Relationship (no AJAX; also uses InlineCreate) <span class="badge badge-warning">New in 4.1</span>', |
| 772 | 772 | 'type' => 'relationship', |
| 773 | 773 | 'name' => 'fallback_icon', |
@@ -782,7 +782,7 @@ discard block |
||
| 782 | 782 | // ----------------- |
| 783 | 783 | // 1-1 relationships |
| 784 | 784 | // ----------------- |
| 785 | - [ // CustomHTML |
|
| 785 | + [// CustomHTML |
|
| 786 | 786 | 'name' => 'select_1_1_heading', |
| 787 | 787 | 'type' => 'custom_html', |
| 788 | 788 | 'value' => '<h5 class="mb-0 text-primary">1-1 Relationships (HasOne)</h5> ', |
@@ -823,13 +823,13 @@ discard block |
||
| 823 | 823 | // ----------------- |
| 824 | 824 | |
| 825 | 825 | return [ |
| 826 | - [ // CustomHTML |
|
| 826 | + [// CustomHTML |
|
| 827 | 827 | 'name' => 'select_heading', |
| 828 | 828 | 'type' => 'custom_html', |
| 829 | 829 | 'value' => '<h5 class="mb-0 text-primary">No Relationship</h5>', |
| 830 | 830 | 'tab' => 'Selects', |
| 831 | 831 | ], |
| 832 | - [ // select_from_array |
|
| 832 | + [// select_from_array |
|
| 833 | 833 | 'name' => 'select_from_array', |
| 834 | 834 | 'label' => 'Select_from_array (no relationship, 1-1 or 1-n)', |
| 835 | 835 | 'type' => 'select_from_array', |
@@ -839,7 +839,7 @@ discard block |
||
| 839 | 839 | 'allows_multiple' => false, // OPTIONAL; needs you to cast this to array in your model; |
| 840 | 840 | 'wrapperAttributes' => ['class' => 'form-group col-md-6'], |
| 841 | 841 | ], |
| 842 | - [ // select2_from_array |
|
| 842 | + [// select2_from_array |
|
| 843 | 843 | 'name' => 'select2_from_array', |
| 844 | 844 | 'label' => 'Select2_from_array (no relationship, 1-1 or 1-n)', |
| 845 | 845 | 'type' => 'select2_from_array', |
@@ -849,7 +849,7 @@ discard block |
||
| 849 | 849 | 'allows_multiple' => false, // OPTIONAL; needs you to cast this to array in your model; |
| 850 | 850 | 'wrapperAttributes' => ['class' => 'form-group col-md-6'], |
| 851 | 851 | ], |
| 852 | - [ // select_and_order |
|
| 852 | + [// select_and_order |
|
| 853 | 853 | 'name' => 'select_and_order', |
| 854 | 854 | 'label' => 'Select_and_order', |
| 855 | 855 | 'type' => 'select_and_order', |
@@ -879,7 +879,7 @@ discard block |
||
| 879 | 879 | $fields = []; |
| 880 | 880 | |
| 881 | 881 | if (app('env') == 'production') { |
| 882 | - $fields[] = [ // CustomHTML |
|
| 882 | + $fields[] = [// CustomHTML |
|
| 883 | 883 | 'name' => 'separator', |
| 884 | 884 | 'type' => 'custom_html', |
| 885 | 885 | 'value' => '<p><small><strong>Note: </strong>In the online demo we\'ve restricted the upload and media library fields a lot, or hidden them entirely. To test them out, you can <a target="_blank" href="https://backpackforlaravel.com/docs/demo">download and install this demo admin panel</a> in your local environment.</small></p>', |
@@ -887,14 +887,14 @@ discard block |
||
| 887 | 887 | ]; |
| 888 | 888 | } |
| 889 | 889 | |
| 890 | - $fields[] = [ // Browse |
|
| 890 | + $fields[] = [// Browse |
|
| 891 | 891 | 'name' => 'browse', |
| 892 | 892 | 'label' => 'Browse (using elFinder)', |
| 893 | 893 | 'type' => 'browse', |
| 894 | 894 | 'tab' => 'Uploads', |
| 895 | 895 | ]; |
| 896 | 896 | |
| 897 | - $fields[] = [ // Browse multiple |
|
| 897 | + $fields[] = [// Browse multiple |
|
| 898 | 898 | 'name' => 'browse_multiple', |
| 899 | 899 | 'label' => 'Browse multiple', |
| 900 | 900 | 'type' => 'browse_multiple', |
@@ -904,7 +904,7 @@ discard block |
||
| 904 | 904 | // 'mime_types' => null, // visible mime prefixes; ex. ['image'] or ['application/pdf'] |
| 905 | 905 | ]; |
| 906 | 906 | |
| 907 | - $fields[] = [ // Upload |
|
| 907 | + $fields[] = [// Upload |
|
| 908 | 908 | 'name' => 'upload', |
| 909 | 909 | 'label' => 'Upload', |
| 910 | 910 | 'type' => 'upload', |
@@ -915,7 +915,7 @@ discard block |
||
| 915 | 915 | 'tab' => 'Uploads', |
| 916 | 916 | ]; |
| 917 | 917 | |
| 918 | - $fields[] = [ // Upload |
|
| 918 | + $fields[] = [// Upload |
|
| 919 | 919 | 'name' => 'upload_multiple', |
| 920 | 920 | 'label' => 'Upload Multiple', |
| 921 | 921 | 'type' => 'upload_multiple', |
@@ -926,7 +926,7 @@ discard block |
||
| 926 | 926 | 'tab' => 'Uploads', |
| 927 | 927 | ]; |
| 928 | 928 | |
| 929 | - $fields[] = [ // base64_image |
|
| 929 | + $fields[] = [// base64_image |
|
| 930 | 930 | 'label' => 'Base64 Image - includes cropping', |
| 931 | 931 | 'name' => 'base64_image', |
| 932 | 932 | 'filename' => null, // set to null if not needed |
@@ -937,7 +937,7 @@ discard block |
||
| 937 | 937 | 'tab' => 'Uploads', |
| 938 | 938 | ]; |
| 939 | 939 | |
| 940 | - $fields[] = [ // image |
|
| 940 | + $fields[] = [// image |
|
| 941 | 941 | 'label' => 'Image - includes cropping', |
| 942 | 942 | 'name' => 'image', |
| 943 | 943 | 'type' => 'image', |
@@ -959,32 +959,32 @@ discard block |
||
| 959 | 959 | // ----------------- |
| 960 | 960 | |
| 961 | 961 | return [ |
| 962 | - [ // SimpleMDE |
|
| 962 | + [// SimpleMDE |
|
| 963 | 963 | 'name' => 'easymde', |
| 964 | 964 | 'label' => 'EasyMDE - markdown editor (well-maintained fork of SimpleMDE)', |
| 965 | 965 | 'type' => 'easymde', |
| 966 | 966 | 'tab' => 'Big texts', |
| 967 | 967 | 'fake' => true, |
| 968 | 968 | ], |
| 969 | - [ // Summernote |
|
| 969 | + [// Summernote |
|
| 970 | 970 | 'name' => 'summernote', |
| 971 | 971 | 'label' => 'Summernote editor', |
| 972 | 972 | 'type' => 'summernote', |
| 973 | 973 | 'tab' => 'Big texts', |
| 974 | 974 | ], |
| 975 | - [ // CKEditor |
|
| 975 | + [// CKEditor |
|
| 976 | 976 | 'name' => 'wysiwyg', |
| 977 | 977 | 'label' => 'CKEditor - also called the WYSIWYG field', |
| 978 | 978 | 'type' => 'ckeditor', |
| 979 | 979 | 'tab' => 'Big texts', |
| 980 | 980 | ], |
| 981 | - [ // TinyMCE |
|
| 981 | + [// TinyMCE |
|
| 982 | 982 | 'name' => 'tinymce', |
| 983 | 983 | 'label' => 'TinyMCE', |
| 984 | 984 | 'type' => 'tinymce', |
| 985 | 985 | 'tab' => 'Big texts', |
| 986 | 986 | ], |
| 987 | - [ // SimpleMDE |
|
| 987 | + [// SimpleMDE |
|
| 988 | 988 | 'name' => 'simplemde', |
| 989 | 989 | 'label' => 'SimpleMDE', |
| 990 | 990 | 'type' => 'easymde', |
@@ -1000,7 +1000,7 @@ discard block |
||
| 1000 | 1000 | // ----------------- |
| 1001 | 1001 | |
| 1002 | 1002 | return [ |
| 1003 | - [ // Color |
|
| 1003 | + [// Color |
|
| 1004 | 1004 | 'name' => 'color', |
| 1005 | 1005 | 'label' => 'Color picker (HTML5 spec)', |
| 1006 | 1006 | 'type' => 'color', |
@@ -1008,7 +1008,7 @@ discard block |
||
| 1008 | 1008 | 'tab' => 'Miscellaneous', |
| 1009 | 1009 | 'wrapperAttributes' => ['class' => 'form-group col-md-6'], |
| 1010 | 1010 | ], |
| 1011 | - [ // Color |
|
| 1011 | + [// Color |
|
| 1012 | 1012 | 'name' => 'color_picker', |
| 1013 | 1013 | 'label' => 'Color picker (jQuery plugin)', |
| 1014 | 1014 | 'type' => 'color_picker', |
@@ -1016,14 +1016,14 @@ discard block |
||
| 1016 | 1016 | 'tab' => 'Miscellaneous', |
| 1017 | 1017 | 'wrapperAttributes' => ['class' => 'form-group col-md-6'], |
| 1018 | 1018 | ], |
| 1019 | - [ // URL |
|
| 1019 | + [// URL |
|
| 1020 | 1020 | 'name' => 'video', |
| 1021 | 1021 | 'label' => 'Video - link to video file on Youtube or Vimeo', |
| 1022 | 1022 | 'type' => 'video', |
| 1023 | 1023 | 'tab' => 'Miscellaneous', |
| 1024 | 1024 | 'wrapperAttributes' => ['class' => 'form-group col-md-5'], |
| 1025 | 1025 | ], |
| 1026 | - [ // Range |
|
| 1026 | + [// Range |
|
| 1027 | 1027 | 'name' => 'range', |
| 1028 | 1028 | 'label' => 'Range', |
| 1029 | 1029 | 'type' => 'range', |
@@ -1043,7 +1043,7 @@ discard block |
||
| 1043 | 1043 | 'tab' => 'Miscellaneous', |
| 1044 | 1044 | 'wrapperAttributes' => ['class' => 'form-group col-md-2'], |
| 1045 | 1045 | ], |
| 1046 | - [ // Table |
|
| 1046 | + [// Table |
|
| 1047 | 1047 | 'name' => 'table', |
| 1048 | 1048 | 'label' => 'Table', |
| 1049 | 1049 | 'type' => 'table', |
@@ -1057,7 +1057,7 @@ discard block |
||
| 1057 | 1057 | 'min' => 0, // minimum rows allowed in the table |
| 1058 | 1058 | 'tab' => 'Miscellaneous', |
| 1059 | 1059 | ], |
| 1060 | - [ // Table |
|
| 1060 | + [// Table |
|
| 1061 | 1061 | 'name' => 'fake_table', |
| 1062 | 1062 | 'label' => 'Fake Table', |
| 1063 | 1063 | 'type' => 'table', |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | // only consider fields that have both name and label (needed for table column) |
| 109 | 109 | // reject custom_html fields (since they have no value) |
| 110 | - $validFields = collect($groupFields)->reject(function ($value, $key) { |
|
| 110 | + $validFields = collect($groupFields)->reject(function($value, $key) { |
|
| 111 | 111 | $is_custom_html_field = $value['type'] ?? '' == 'custom_html'; |
| 112 | 112 | $does_not_have_label = !isset($value['label']); |
| 113 | 113 | $does_not_have_name = !isset($value['name']); |
@@ -158,11 +158,11 @@ discard block |
||
| 158 | 158 | 'enum', // doesn't make sense inside repeatable |
| 159 | 159 | 'page_or_link', // only available in PageManager package |
| 160 | 160 | 'upload', // currently impossible to make it work inside repeatable; |
| 161 | - 'upload_multiple', // currently impossible to make it work inside repeatable; |
|
| 161 | + 'upload_multiple', // currently impossible to make it work inside repeatable; |
|
| 162 | 162 | ]; |
| 163 | 163 | |
| 164 | 164 | foreach ($groups as $groupKey => $fields) { |
| 165 | - $groups[$groupKey] = Arr::where($fields, function ($field) use ($excludedFieldTypes) { |
|
| 165 | + $groups[$groupKey] = Arr::where($fields, function($field) use ($excludedFieldTypes) { |
|
| 166 | 166 | // eliminate fields that have 1-1 relationships |
| 167 | 167 | // (determined by the fact that their names use dot notation) |
| 168 | 168 | if (is_string($field['name']) && strpos($field['name'], '.') != 0) { |