Как сделатьТак, как написано в https://laravel.com/docs/6.x/configuration
public function via(Builder $builder)
{
$this->builder = $builder;
}
public function build($argument)
{
$this->builder->where('field', $argument)->...;
}
$this->singletons = [
Resolver::class => Resolver::class
];
public function __construct(Resolver $resolver)
{
$this->resolver = $resolver;
}
public function index($argument)
{
return $resolver->via(Model::query())->build($argument);
}
PasswordBrokerManager
со всеми сопутствующими классами — PasswordBroker
и TokenRepositoryInterface
, подменяешь и пользуешься.