Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kainiklas committed Dec 14, 2023
2 parents 9dfdf65 + 9967fb9 commit 6263546
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/FilamentScoutServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,4 @@ public function packageRegistered(): void
public function packageBooted(): void
{
}

}
8 changes: 4 additions & 4 deletions src/Providers/MeilisearchGlobalSearchProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ public function getResults(string $query): ?GlobalSearchResults
$builder = GlobalSearchResults::make();

foreach (Filament::getResources() as $resource) {
/** @var Resource $resource * */
if (!$resource::canGloballySearch()) {
/** @var resource $resource * */
if (! $resource::canGloballySearch()) {
continue;
}

if (!method_exists($resource::getModel(), 'search')) {
if (! method_exists($resource::getModel(), 'search')) {
throw new Exception('The model is not searchable. Please add the Laravel Scout trait Searchable to the model.');
}

Expand Down Expand Up @@ -74,7 +74,7 @@ function ($meiliSearch, string $query, array $options) {
})
->filter();

if (!$resourceResults->count()) {
if (! $resourceResults->count()) {
continue;
}

Expand Down
6 changes: 3 additions & 3 deletions src/Providers/ScoutGlobalSearchProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ public function getResults(string $query): ?GlobalSearchResults
$builder = GlobalSearchResults::make();

foreach (Filament::getResources() as $resource) {
if (!$resource::canGloballySearch()) {
if (! $resource::canGloballySearch()) {
continue;
}

if (!method_exists($resource::getModel(), 'search')) {
if (! method_exists($resource::getModel(), 'search')) {
throw new Exception('The model is not searchable. Please add the Laravel Scout trait Searchable to the model.');
}

Expand All @@ -44,7 +44,7 @@ public function getResults(string $query): ?GlobalSearchResults
})
->filter();

if (!$resourceResults->count()) {
if (! $resourceResults->count()) {
continue;
}

Expand Down

0 comments on commit 6263546

Please sign in to comment.