@extends('admin.layouts.app') @section('title', $post->exists ? 'Edit post' : 'New post') @section('crumbs') Blog {{ $post->exists ? $post->title : 'New post' }} @endsection @section('content') @php $selectedIds = collect(old('products', $selected))->map(fn ($v) => (int) $v)->all(); @endphp
@csrf @if ($post->exists) @method('PUT') @endif

Content

@include('admin.partials.field', ['name' => 'title', 'label' => 'Title', 'value' => $post->title, 'required' => true, 'full' => true]) @include('admin.partials.slug-field', ['model' => $post, 'from' => 'f_title', 'source' => 'title'])
@error('blog_category_id')
{{ $message }}
@enderror
@include('admin.partials.field', ['name' => 'excerpt', 'label' => 'Excerpt', 'type' => 'textarea', 'rows' => 3, 'value' => $post->excerpt, 'full' => true]) @include('admin.partials.field', ['name' => 'body', 'label' => 'Body', 'type' => 'textarea', 'rows' => 16, 'value' => $post->body, 'required' => true, 'full' => true, 'hint' => 'HTML allowed (

,

,
    , …).']) @include('admin.partials.field', ['name' => 'tags', 'label' => 'Tags', 'value' => implode(', ', $post->tags ?? []), 'placeholder' => 'health, tea, tips', 'hint' => 'Comma separated.']) @include('admin.partials.field', ['name' => 'author', 'label' => 'Author', 'value' => $post->author])

Publish

@include('admin.partials.field', ['name' => 'published_at', 'label' => 'Publish date', 'type' => 'datetime-local', 'value' => $post->published_at?->format('Y-m-d\TH:i'), 'full' => true, 'hint' => 'Future date = scheduled.'])
@include('admin.partials.check', ['name' => 'is_published', 'label' => 'Published', 'checked' => $post->is_published, 'hint' => 'Off = draft'])
Cancel

Cover & look

@include('admin.partials.field', ['name' => 'icon', 'label' => 'Icon (emoji)', 'value' => $post->icon, 'placeholder' => '🍵']) @include('admin.partials.field', ['name' => 'bg', 'label' => 'Background (CSS)', 'value' => $post->bg, 'placeholder' => 'linear-gradient(…)']) @include('admin.partials.image', ['name' => 'cover', 'label' => 'Cover image', 'path' => $post->cover, 'hint' => 'Max 4 MB.'])

Related products

{{ count($selectedIds) }} selected
Hold Ctrl (⌘ on Mac) to select multiple. @error('products.*')
{{ $message }}
@enderror
@endsection