FleetCart/Modules/Support/Search/Searchable.php
2023-06-11 13:14:03 +01:00

27 lines
587 B
PHP

<?php
namespace Modules\Support\Search;
use Laravel\Scout\Searchable as ScoutSearchable;
trait Searchable
{
use ScoutSearchable {
ScoutSearchable::search as scoutSearch;
}
/**
* Perform a search against the model's indexed data.
*
* @param string $query
* @param Closure $callback
* @return \Modules\Support\Search\Builder
*/
public function search($query, $callback = null)
{
$scoutBuilder = $this->scoutSearch($query, $callback);
return new Builder($this, $scoutBuilder);
}
}