Files
libra/resources/views/livewire/pages/posts/show.blade.php
T
2026-10-31 18:54:18 +02:00

35 lines
1.1 KiB
PHP

<?php
use App\Enums\PostStatus;
use App\Models\Post;
use Livewire\Attributes\Layout;
use Livewire\Volt\Component;
new #[Layout('components.layouts.public')] class extends Component
{
public Post $post;
public function mount(Post $post): void
{
// Only show published posts
abort_unless($post->status === PostStatus::Published, 404);
$this->post = $post;
}
}; ?>
<section class="sec" style="padding-top:56px">
<article class="wrap" style="max-width:768px">
<span class="meta">{{ $post->published_at?->translatedFormat('l, d F Y') ?? $post->created_at->translatedFormat('l, d F Y') }}</span>
<h1 style="font-size:clamp(2rem,3.4vw,3rem);margin:10px 0 28px">{{ $post->getTitle() }}</h1>
<div class="prose prose-lg prose-brand max-w-none site-prose">
{!! $post->getBody() !!}
</div>
<footer style="border-top:1px solid var(--line);margin-top:48px;padding-top:24px">
<a class="btn btn-ghost" href="{{ route('posts.index') }}" wire:navigate>{{ __('posts.back_to_posts') }}</a>
</footer>
</article>
</section>