mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
news module added
This commit is contained in:
32
app/Http/Livewire/News/ArticleOverview.php
Normal file
32
app/Http/Livewire/News/ArticleOverview.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Livewire\News;
|
||||
|
||||
use App\Models\LibraryItem;
|
||||
use Livewire\Component;
|
||||
use RalphJSmit\Laravel\SEO\Support\SEOData;
|
||||
|
||||
class ArticleOverview extends Component
|
||||
{
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.news.article-overview', [
|
||||
'libraryItems' => LibraryItem::query()
|
||||
->with([
|
||||
'createdBy.roles',
|
||||
'lecturer',
|
||||
'tags',
|
||||
])
|
||||
->where('type', 'markdown_article')
|
||||
->whereHas('createdBy.roles',
|
||||
fn($query) => $query->where('roles.name', 'news-editor'))
|
||||
->get(),
|
||||
])->layout('layouts.app', [
|
||||
'SEOData' => new SEOData(
|
||||
title: __('News'),
|
||||
description: __('Here we post important news that is relevant for everyone.'),
|
||||
image: asset('img/einundzwanzig-wallpaper-benrath.png'),
|
||||
)
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user