FleetCart/Modules/Support/Search/Searchable.php

27 lines
587 B
PHP
Raw Normal View History

2023-06-11 12:14:03 +00:00
<?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);
}
}