mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
autors overview
This commit is contained in:
23
app/Http/Livewire/News/AuthorsOverview.php
Normal file
23
app/Http/Livewire/News/AuthorsOverview.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Livewire\News;
|
||||
|
||||
use App\Models\Lecturer;
|
||||
use Livewire\Component;
|
||||
|
||||
class AuthorsOverview extends Component
|
||||
{
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.news.authors-overview', [
|
||||
'authors' => Lecturer::query()
|
||||
->whereHas('libraryItems', function ($query) {
|
||||
$query->where('library_items.news', true);
|
||||
})
|
||||
->withCount([
|
||||
'libraryItems' => fn($query) => $query->where('library_items.news', true),
|
||||
])
|
||||
->get(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user