mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
filters updated
This commit is contained in:
@@ -18,7 +18,9 @@ class Library extends Component
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.frontend.library', [
|
||||
'libraries' => \App\Models\Library::get()
|
||||
'libraries' => \App\Models\Library::query()
|
||||
->where('is_public', true)
|
||||
->get()
|
||||
->prepend(\App\Models\Library::make([
|
||||
'name' => 'Alle',
|
||||
])),
|
||||
|
||||
@@ -18,7 +18,17 @@ class SearchByTagInLibrary extends Component
|
||||
{
|
||||
return view('livewire.frontend.search-by-tag-in-library', [
|
||||
'tags' => Tag::query()
|
||||
->with([
|
||||
'libraryItems.libraries',
|
||||
'libraryItems.lecturer',
|
||||
])
|
||||
->withCount([
|
||||
'libraryItems',
|
||||
])
|
||||
->where('type', 'library_item')
|
||||
->whereHas('libraryItems.libraries', function ($query) {
|
||||
$query->where('is_public', true);
|
||||
})
|
||||
->get(),
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user