diff --git a/app/Nova/Filters/LibraryItemWithoutLibrary.php b/app/Nova/Filters/LibraryItemWithout.php similarity index 66% rename from app/Nova/Filters/LibraryItemWithoutLibrary.php rename to app/Nova/Filters/LibraryItemWithout.php index b3881b50..1c523e24 100644 --- a/app/Nova/Filters/LibraryItemWithoutLibrary.php +++ b/app/Nova/Filters/LibraryItemWithout.php @@ -5,7 +5,7 @@ namespace App\Nova\Filters; use Laravel\Nova\Filters\BooleanFilter; use Laravel\Nova\Http\Requests\NovaRequest; -class LibraryItemWithoutLibrary extends BooleanFilter +class LibraryItemWithout extends BooleanFilter { /** * Apply the filter to the given query. @@ -18,7 +18,9 @@ class LibraryItemWithoutLibrary extends BooleanFilter */ public function apply(NovaRequest $request, $query, $value) { - return $query->when($value['without'], fn($query) => $query->whereDoesntHave('libraries')); + return $query + ->when($value['libraries'], fn($query) => $query->whereDoesntHave('libraries')) + ->when($value['tags'], fn($query) => $query->whereDoesntHave('tags')); } /** @@ -31,7 +33,8 @@ class LibraryItemWithoutLibrary extends BooleanFilter public function options(NovaRequest $request) { return [ - 'Library-Item without Library' => 'without', + __('Library items without libraries') => 'libraries', + __('Library items without tags') => 'tags', ]; } } diff --git a/app/Nova/LibraryItem.php b/app/Nova/LibraryItem.php index 7ead3e41..8bee16a3 100644 --- a/app/Nova/LibraryItem.php +++ b/app/Nova/LibraryItem.php @@ -6,7 +6,7 @@ use App\Enums\LibraryItemType; use App\Notifications\ModelCreatedNotification; use App\Nova\Actions\AttachLibraryItemToLibrary; use App\Nova\Actions\SetStatusAction; -use App\Nova\Filters\LibraryItemWithoutLibrary; +use App\Nova\Filters\LibraryItemWithout; use Ebess\AdvancedNovaMediaLibrary\Fields\Files; use Ebess\AdvancedNovaMediaLibrary\Fields\Images; use Illuminate\Database\Eloquent\Model; @@ -200,7 +200,7 @@ class LibraryItem extends Resource public function filters(Request $request) { return [ - new LibraryItemWithoutLibrary() + new LibraryItemWithout() ]; } diff --git a/resources/lang/de.json b/resources/lang/de.json index 59f91fb4..ab45dc88 100644 --- a/resources/lang/de.json +++ b/resources/lang/de.json @@ -690,5 +690,7 @@ "starts with: lnurl1dp68gurn8gh....": "startet mit: lnurl1dp68gurn8gh....", "for example xy@getalby.com": "zum Beispiel xy@getalby.com", "Only one working address is required. But you can also fill in all fields if you have suitable data.": "Nur eine funktionierende Adresse ist erforderlich. Aber du kannst auch alle Felder ausfüllen, wenn du passende Daten hast.", - "Reset filtering and search": "Suche und Filter zurücksetzen" + "Reset filtering and search": "Suche und Filter zurücksetzen", + "Library items without libraries": "Einträge ohne Bibliothek", + "Library items without tags": "Einträge ohne Tags" } diff --git a/resources/lang/en.json b/resources/lang/en.json index 12e8e960..392adf5a 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -684,5 +684,7 @@ "starts with: lnurl1dp68gurn8gh....": "", "for example xy@getalby.com": "", "Only one working address is required. But you can also fill in all fields if you have suitable data.": "", - "Reset filtering and search": "" + "Reset filtering and search": "", + "Library items without libraries": "", + "Library items without tags": "" } \ No newline at end of file diff --git a/resources/lang/es.json b/resources/lang/es.json index 413a4e7a..ed504838 100644 --- a/resources/lang/es.json +++ b/resources/lang/es.json @@ -684,5 +684,7 @@ "starts with: lnurl1dp68gurn8gh....": "", "for example xy@getalby.com": "", "Only one working address is required. But you can also fill in all fields if you have suitable data.": "", - "Reset filtering and search": "" + "Reset filtering and search": "", + "Library items without libraries": "", + "Library items without tags": "" } \ No newline at end of file diff --git a/resources/lang/fr.json b/resources/lang/fr.json index f315d04f..45c68e94 100644 --- a/resources/lang/fr.json +++ b/resources/lang/fr.json @@ -685,5 +685,7 @@ "starts with: lnurl1dp68gurn8gh....": "", "for example xy@getalby.com": "", "Only one working address is required. But you can also fill in all fields if you have suitable data.": "", - "Reset filtering and search": "" + "Reset filtering and search": "", + "Library items without libraries": "", + "Library items without tags": "" } \ No newline at end of file diff --git a/resources/lang/hr.json b/resources/lang/hr.json index 9bcb58f9..6c71d032 100644 --- a/resources/lang/hr.json +++ b/resources/lang/hr.json @@ -685,5 +685,7 @@ "starts with: lnurl1dp68gurn8gh....": "", "for example xy@getalby.com": "", "Only one working address is required. But you can also fill in all fields if you have suitable data.": "", - "Reset filtering and search": "" + "Reset filtering and search": "", + "Library items without libraries": "", + "Library items without tags": "" } \ No newline at end of file diff --git a/resources/lang/it.json b/resources/lang/it.json index 1b0e4ef5..7c07ab98 100644 --- a/resources/lang/it.json +++ b/resources/lang/it.json @@ -685,5 +685,7 @@ "starts with: lnurl1dp68gurn8gh....": "", "for example xy@getalby.com": "", "Only one working address is required. But you can also fill in all fields if you have suitable data.": "", - "Reset filtering and search": "" + "Reset filtering and search": "", + "Library items without libraries": "", + "Library items without tags": "" } \ No newline at end of file diff --git a/resources/lang/mk.json b/resources/lang/mk.json index 255046f8..64dc8aac 100644 --- a/resources/lang/mk.json +++ b/resources/lang/mk.json @@ -685,5 +685,7 @@ "starts with: lnurl1dp68gurn8gh....": "", "for example xy@getalby.com": "", "Only one working address is required. But you can also fill in all fields if you have suitable data.": "", - "Reset filtering and search": "" + "Reset filtering and search": "", + "Library items without libraries": "", + "Library items without tags": "" } \ No newline at end of file diff --git a/resources/lang/pl.json b/resources/lang/pl.json index 5cf51a0b..a9cfc5fd 100644 --- a/resources/lang/pl.json +++ b/resources/lang/pl.json @@ -685,5 +685,7 @@ "starts with: lnurl1dp68gurn8gh....": "", "for example xy@getalby.com": "", "Only one working address is required. But you can also fill in all fields if you have suitable data.": "", - "Reset filtering and search": "" + "Reset filtering and search": "", + "Library items without libraries": "", + "Library items without tags": "" } \ No newline at end of file diff --git a/resources/lang/pt.json b/resources/lang/pt.json index 436185d6..89f95aae 100644 --- a/resources/lang/pt.json +++ b/resources/lang/pt.json @@ -685,5 +685,7 @@ "starts with: lnurl1dp68gurn8gh....": "", "for example xy@getalby.com": "", "Only one working address is required. But you can also fill in all fields if you have suitable data.": "", - "Reset filtering and search": "" + "Reset filtering and search": "", + "Library items without libraries": "", + "Library items without tags": "" } \ No newline at end of file diff --git a/resources/lang/tr.json b/resources/lang/tr.json index 2e8f3737..4d6c45ca 100644 --- a/resources/lang/tr.json +++ b/resources/lang/tr.json @@ -659,5 +659,7 @@ "starts with: lnurl1dp68gurn8gh....": "", "for example xy@getalby.com": "", "Only one working address is required. But you can also fill in all fields if you have suitable data.": "", - "Reset filtering and search": "" + "Reset filtering and search": "", + "Library items without libraries": "", + "Library items without tags": "" } \ No newline at end of file