2c068277a2
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
35 lines
1.1 KiB
PHP
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>
|