Implement very basic API searching. Closes #1348
This commit is contained in:
committed by
James Brooks
parent
9379ab131c
commit
0b3483fb8a
@@ -12,6 +12,7 @@
|
||||
namespace CachetHQ\Cachet\Models;
|
||||
|
||||
use AltThree\Validator\ValidatingTrait;
|
||||
use CachetHQ\Cachet\Models\Traits\SearchableTrait;
|
||||
use CachetHQ\Cachet\Models\Traits\SortableTrait;
|
||||
use CachetHQ\Cachet\Presenters\IncidentPresenter;
|
||||
use Carbon\Carbon;
|
||||
@@ -21,7 +22,7 @@ use McCool\LaravelAutoPresenter\HasPresenter;
|
||||
|
||||
class Incident extends Model implements HasPresenter
|
||||
{
|
||||
use SoftDeletes, SortableTrait, ValidatingTrait;
|
||||
use SearchableTrait, SoftDeletes, SortableTrait, ValidatingTrait;
|
||||
|
||||
/**
|
||||
* The attributes that should be casted to native types.
|
||||
@@ -63,6 +64,18 @@ class Incident extends Model implements HasPresenter
|
||||
'message' => 'required',
|
||||
];
|
||||
|
||||
/**
|
||||
* The searchable fields.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $searchable = [
|
||||
'id',
|
||||
'name',
|
||||
'status',
|
||||
'visible',
|
||||
];
|
||||
|
||||
/**
|
||||
* The sortable fields.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user