20 lines
435 B
PHP
20 lines
435 B
PHP
|
<?php declare(strict_types=1);
|
||
|
|
||
|
namespace App\Services\Search;
|
||
|
|
||
|
use App\Contracts\Search;
|
||
|
use Illuminate\Database\Eloquent\Builder;
|
||
|
use Illuminate\Database\Eloquent\Relations\Relation;
|
||
|
|
||
|
final readonly class CreateSearchInstanceCommand
|
||
|
{
|
||
|
public function __construct(
|
||
|
private string $abstract
|
||
|
) { }
|
||
|
|
||
|
public function execute(Relation | Builder $query): Search
|
||
|
{
|
||
|
return new $this->abstract($query);
|
||
|
}
|
||
|
}
|