@php $editId = (int) request('edit'); $row = $editId ? $articles->firstWhere('id', $editId) : null; $open = $row || request()->has('new') || $errors->any(); $live = $articles->where('status', 'published')->count(); $cats = $articles->pluck('category')->filter()->unique()->sort()->values(); @endphp @if($open)
@csrf

{{ $row ? 'Edit article' : 'New article' }}

Cancel
@error('title')
{{ $message }}
@enderror
{{ url('/blog') }}/
Lowercase letters, numbers and hyphens. Leave empty to generate it from the title. Changing the address of a live article breaks links that already point to it.
@error('slug')
{{ $message }}
@enderror
One or two sentences shown on the blog list and in link previews. Falls back to the start of the article.
@error('excerpt')
{{ $message }}
@enderror
Markdown: ## Heading, **bold**, *italic*, - list, [link text](https://…), > quote. Raw HTML is stripped. The preview is an approximation of the live page.
@error('content')
{{ $message }}
@enderror

Publishing

Drafts are hidden from the blog, sitemap and search engines.
@error('status')
{{ $message }}
@enderror
@if($cats->isNotEmpty())
@foreach($cats as $c)@endforeach
@endif

Cover image

@if($row?->cover_url)Current cover image@else@endif
{{ $row?->cover_url ? 'Replace the cover image' : 'Add a cover image' }}
JPG, PNG or WebP · 1200 × 630 works best · up to 3 MB
@error('cover')
{{ $message }}
@enderror

Search & sharing

Keyword first, about 60 characters. Empty uses the title.
@error('seo_title')
{{ $message }}
@enderror
Answer the reader's question directly, about 155 characters.
@error('meta_description')
{{ $message }}
@enderror
{{ parse_url(url('/'), PHP_URL_HOST) }} › blog › …
{{ old('seo_title', $row?->seo_title ?: $row?->title) ?: 'Article title' }}
{{ old('meta_description', $row?->meta_description) ?: 'Your meta description appears here.' }}
Cancel
@endif

Articles

{{ $articles->count() }} total · {{ $live }} published · {{ $articles->count() - $live }} {{ \Illuminate\Support\Str::plural('draft', $articles->count() - $live) }}
@unless($open) New article@endunless
@if($articles->isEmpty()) Write the first article @else
@foreach($articles as $a) @endforeach
ArticleCategoryStatusDateActions
{{ $a->title }}/blog/{{ $a->slug }} {{ $a->category ?: '—' }} {{ $a->publishedOn()?->format('d M Y') }}{{ $a->readingMinutes() }} min read
@csrf
@if($a->status === 'published')@endif
@csrf @method('DELETE')
@endif