Fixes API sorting and filtering. Closes #1489
This commit is contained in:
committed by
James Brooks
parent
98550c31c9
commit
919c7127e7
@@ -12,13 +12,14 @@
|
||||
namespace CachetHQ\Cachet\Models;
|
||||
|
||||
use AltThree\Validator\ValidatingTrait;
|
||||
use CachetHQ\Cachet\Models\Traits\SortableTrait;
|
||||
use CachetHQ\Cachet\Presenters\ComponentGroupPresenter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use McCool\LaravelAutoPresenter\HasPresenter;
|
||||
|
||||
class ComponentGroup extends Model implements HasPresenter
|
||||
{
|
||||
use ValidatingTrait;
|
||||
use SortableTrait, ValidatingTrait;
|
||||
|
||||
/**
|
||||
* The attributes that should be casted to native types.
|
||||
@@ -49,6 +50,18 @@ class ComponentGroup extends Model implements HasPresenter
|
||||
'collapsed' => 'bool',
|
||||
];
|
||||
|
||||
/**
|
||||
* The sortable fields.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $sortable = [
|
||||
'id',
|
||||
'name',
|
||||
'order',
|
||||
'collapsed',
|
||||
];
|
||||
|
||||
/**
|
||||
* The relations to eager load on every query.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user