completed functionality and docs update

This commit is contained in:
glmdev
2016-12-30 23:05:11 +00:00
parent 529f22c4b9
commit 68165c948a
8 changed files with 154 additions and 179 deletions

View 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 );
}
}