@props([ 'board', 'post', 'postBlockBoards' => [], 'authGuard' => 'tenant', 'storeAction' => '', 'updateAction' => '', 'indexAction' => '', 'showUrlTemplate' => '', 'uploadUrl' => '', 'fileUrlBase' => '', 'canSchedulePublishing' => false, 'allowBackdatePublishing' => false, 'canInsertBlocks' => false, 'aiContext' => null, ]) @php $isEdit = $post->exists; $authUser = auth($authGuard)->user(); $previewVariant = $authGuard === 'web' ? 'platform' : 'tenant'; $boardCategories = $board->activeCategories; $canSelectCategory = $board->userCanSelectCategory($authUser); $selectedCategoryId = old('board_category_id', $post->board_category_id ?? $board->effectiveDefaultCategoryId()); $currentTags = old('tags', $post->exists ? $post->tags->pluck('name')->implode(', ') : ''); $publishedAtOldValue = old('published_at'); $publishedAtNativeValue = optional($post->published_at)->format('Y-m-d\TH:i'); if (filled($publishedAtOldValue)) { try { $publishedAtNativeValue = \Illuminate\Support\Carbon::parse($publishedAtOldValue)->format('Y-m-d\TH:i'); } catch (\Throwable $e) { $publishedAtNativeValue = optional($post->published_at)->format('Y-m-d\TH:i'); } } $publishedAtDateValue = old('published_at_date', filled($publishedAtNativeValue) ? \Illuminate\Support\Carbon::parse($publishedAtNativeValue)->format('Y-m-d') : ''); $publishedAtHourValue = old('published_at_hour', filled($publishedAtNativeValue) ? \Illuminate\Support\Carbon::parse($publishedAtNativeValue)->format('H') : ''); $publishedAtMinuteValue = old('published_at_minute', filled($publishedAtNativeValue) ? \Illuminate\Support\Carbon::parse($publishedAtNativeValue)->format('i') : ''); $publishedAtRestricted = $canSchedulePublishing && ! $allowBackdatePublishing; $publishedAtDateMinValue = $publishedAtRestricted ? now()->toDateString() : null; $publishedAtNativeMinValue = $publishedAtRestricted ? now()->startOfMinute()->format('Y-m-d\TH:i') : null; $showPublishedAtField = $canSchedulePublishing && (! $isEdit || ($post->published_at?->isFuture() ?? false)); $selectedThumbnail = old('thumbnail_image', $post->thumbnail); $fileUrlBase = rtrim((string) $fileUrlBase, '/'); $aiContext = is_array($aiContext ?? null) ? $aiContext : []; $isManager = (bool) ($authUser?->isManager() ?? false); $showAiButton = (bool) ($aiContext['show_button'] ?? false); $canOpenAiPanel = (bool) ($aiContext['can_open_panel'] ?? false); $aiPlanLabel = (string) ($aiContext['plan_label'] ?? ''); $aiPlanKey = (string) ($aiContext['plan_key'] ?? ''); $aiAllowedModels = (array) ($aiContext['allowed_models'] ?? []); $aiSelectedModel = (string) ($aiContext['selected_model'] ?? ($aiAllowedModels[0] ?? '')); $aiReasoningEffortOptions = (array) ($aiContext['reasoning_effort_options'] ?? \App\Core\Platform\Ai\AiDefaults::reasoningEffortOptions()); $aiSelectedReasoningEffort = (string) old('reasoning_effort', $aiContext['reasoning_effort'] ?? config('ai.reasoning_effort', \App\Core\Platform\Ai\AiDefaults::REASONING_EFFORT)); $aiUpgradeMessage = (string) ($aiContext['upgrade_message'] ?? ''); $aiWriteAction = (string) ($aiContext['write_action'] ?? ''); $aiCredit = is_array($aiContext['credit'] ?? null) ? $aiContext['credit'] : []; $aiTotalCreditRemaining = $aiCredit['total_credit_remaining'] ?? null; $aiImageContext = is_array($aiContext['image'] ?? null) ? $aiContext['image'] : []; $showAiImageButton = $isManager && (bool) ($aiImageContext['can_generate_images'] ?? false); $aiImageAction = (string) ($aiContext['image_write_action'] ?? ($aiImageContext['write_action'] ?? '')); @endphp
@csrf @if ($isEdit) @method('PUT') @endif
{{ $board->title }}

{{ $isEdit ? '글 수정' : '새 글 쓰기' }}

Tiptap 기반 본문 편집과 이미지 추가/삭제를 참조 프로젝트와 같은 흐름으로 맞췄습니다.

@if ($showAiButton)
AI {{ $canOpenAiPanel ? '사용 가능' : '상위 플랜 필요' }}
@endif
@if ($showAiButton && ! $canOpenAiPanel) @endif @if ($errors->any())
    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif
@if ($showAiButton) @endif @if (! auth($authGuard)->check())
@endif @if ($boardCategories->isNotEmpty() && $canSelectCategory)
@foreach ($boardCategories as $category) @endforeach
@else @endif @if (! ($boardCategories->isNotEmpty() && $canSelectCategory) && $board->effectiveDefaultCategoryId()) @endif @if ($isEdit)
슬러그 수정
@endif
공백 포함 0 공백 제외 0
@if ($canInsertBlocks) @endif
이미지
이미지는 먼저 임시 저장한 뒤, 저장 시 게시글 폴더로 이동합니다.
@if ($isManager) @endif @if ($showAiImageButton) @endif @if ($showAiImageButton) @endif
@if ($isEdit && $post->images->isNotEmpty()) @foreach ($post->images as $image) @php $imageUrl = $fileUrlBase . '/' . ltrim($image->path, '/'); @endphp
@endforeach @endif
@if ($showPublishedAtField)
@endif
@if ($canInsertBlocks) @endif
목록으로 돌아가기
취소 {{ $isEdit ? '수정하기' : '등록하기' }}
@if ($showPublishedAtField) @push('scripts') @endpush @endif