|Model $model */ public static function search(Model|string $model, Criteria $criteria): SearchDriver { $model = $model instanceof Model ? $model : new $model; return match ($driver = Config::get('scout.driver')) { 'elastic' => ElasticsearchDriver::search($model, $criteria), 'collection' => CollectionDriver::search($model, $criteria), default => throw new RuntimeException("Unsupported {$driver} search driver configured."), }; } }