Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleCIBot committed Mar 12, 2024
1 parent 581da01 commit 22fb29b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/app/Http/Controllers/Admin/ArticleCrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function setup()
'name' => 'category_id',
'entity' => 'category',
'attribute' => 'name',
'wrapper' => [
'wrapper' => [
'href' => function ($crud, $column, $entry, $related_key) {
return backpack_url('category/'.$related_key.'/show');
},
Expand All @@ -63,7 +63,7 @@ public function setup()
$this->crud->addFilter([ // select2 filter
'name' => 'category_id',
'type' => 'select2',
'label'=> 'Category',
'label' => 'Category',
], function () {
return \Backpack\NewsCRUD\app\Models\Category::all()->keyBy('id')->pluck('name', 'id')->toArray();
}, function ($value) { // if the filter is active
Expand All @@ -73,7 +73,7 @@ public function setup()
$this->crud->addFilter([ // select2_multiple filter
'name' => 'tags',
'type' => 'select2_multiple',
'label'=> 'Tags',
'label' => 'Tags',
], function () {
return \Backpack\NewsCRUD\app\Models\Tag::all()->keyBy('id')->pluck('name', 'id')->toArray();
}, function ($values) { // if the filter is active
Expand Down
8 changes: 4 additions & 4 deletions src/app/Http/Controllers/Admin/CategoryCrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ protected function setupListOperation()
CRUD::addColumn('slug');
CRUD::addColumn('parent');
CRUD::addColumn([ // select_multiple: n-n relationship (with pivot table)
'label' => 'Articles', // Table column heading
'type' => 'relationship_count',
'name' => 'articles', // the method that defines the relationship in your Model
'wrapper' => [
'label' => 'Articles', // Table column heading
'type' => 'relationship_count',
'name' => 'articles', // the method that defines the relationship in your Model
'wrapper' => [
'href' => function ($crud, $column, $entry, $related_key) {
return backpack_url('article?category_id='.$entry->getKey());
},
Expand Down
4 changes: 2 additions & 2 deletions src/app/Models/Article.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class Article extends Model
// protected $hidden = [];
// protected $dates = [];
protected $casts = [
'featured' => 'boolean',
'date' => 'date',
'featured' => 'boolean',
'date' => 'date',
];

/**
Expand Down

0 comments on commit 22fb29b

Please sign in to comment.