completed functionality and docs update
This commit is contained in:
28
src/SearchableAgreement.php
Normal file
28
src/SearchableAgreement.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?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 );
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user