@props([ 'board', 'variant' => 'tenant', 'post' => null, 'mode' => 'index', ]) @php $authGuard = $variant === 'platform' ? 'web' : 'tenant'; $currentUser = auth($authGuard)->user(); $isManager = $currentUser?->isManager() ?? false; $isShowMode = $mode === 'show' && $post; $indexUrl = $variant === 'platform' ? route('platform.posts.index', $board) : tenant_url(null, $board->slug); $createUrl = $variant === 'platform' ? route('platform.posts.create', $board) : tenant_url(null, $board->slug . '/create'); $editUrl = $isShowMode ? ($variant === 'platform' ? route('platform.posts.edit', ['board' => $board, 'post' => $post]) : tenant_url(null, $board->slug . '/' . $post->slug . '/edit')) : null; $deleteAction = $isShowMode ? ($variant === 'platform' ? route('platform.posts.destroy', ['board' => $board, 'post' => $post]) : tenant_url(null, $board->slug . '/' . $post->slug)) : null; $guestPasswordUrl = $isShowMode && $post->isGuest() ? ($variant === 'platform' ? route('platform.posts.password', ['board' => $board, 'post' => $post]) : tenant_url(null, $board->slug . '/' . $post->slug . '/password')) : null; @endphp @if ($isManager)
Pages {{ $board->title }}
@if ($isShowMode) 목록으로 @endif 페이지 작성 @if ($editUrl) 수정 @endif @if ($deleteAction)
@csrf @method('DELETE') 삭제
@endif @if ($guestPasswordUrl) 비회원 수정/삭제 @endif
@endif