mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
34 lines
1.2 KiB
PHP
34 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Livewire\News;
|
|
|
|
use App\Models\LibraryItem;
|
|
use Carbon\Carbon;
|
|
use Livewire\Component;
|
|
use RalphJSmit\Laravel\SEO\Support\SEOData;
|
|
|
|
class InternArticleView extends Component
|
|
{
|
|
public LibraryItem $libraryItem;
|
|
|
|
public function render()
|
|
{
|
|
if ($this->libraryItem->type === 'markdown_article') {
|
|
$description = $this->libraryItem->excerpt ?? __('An entry in the library of Einundzwanzig.');
|
|
} else {
|
|
$description = $this->libraryItem->excerpt ?? __('Here we post important news that is relevant for everyone.');
|
|
}
|
|
|
|
return view('livewire.news.intern-article-view')->layout('layouts.app', [
|
|
'SEOData' => new SEOData(
|
|
title: $this->libraryItem->name,
|
|
description: strip_tags($this->libraryItem->excerpt) ?? __('Here we post important news that is relevant for everyone.'),
|
|
author: $this->libraryItem->lecturer->name,
|
|
image: $this->libraryItem->getFirstMedia('main') ? $this->libraryItem->getFirstMediaUrl('main') : asset('img/einundzwanzig-wallpaper-benrath.png'),
|
|
published_time: Carbon::parse($this->libraryItem->created_at),
|
|
type: 'article',
|
|
)
|
|
]);
|
|
}
|
|
}
|