You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
584 B
28 lines
584 B
<?php
|
|
|
|
namespace Glmdev\Search;
|
|
|
|
trait SearchableAgreement {
|
|
|
|
/**
|
|
* returns the searchable fields from the protected $searchable array
|
|
*
|
|
* @return array
|
|
*/
|
|
public static function getSearchable(){
|
|
$inst = new self();
|
|
return $inst->searchable;
|
|
}
|
|
|
|
/**
|
|
* searches the model for the query and returns the results
|
|
*
|
|
* @param string $query
|
|
*
|
|
* @return \Illuminate\Support\Collection
|
|
*/
|
|
public static function search( $query ){
|
|
return \Search::search( self::class, $query );
|
|
}
|
|
|
|
} |