@extends('layouts.admin') @use('App\Enums\ArticleStatus') @use('App\Enums\ArticleVisibility') @use('App\Http\Requests\Admin\ArticleRequest') @php $isEdit = $article->exists; $seo = $article->seo; $countryId = old('country_id', $article->country_id); $categoryId = old('category_id', $article->category_id); $currentCategory = $categoryTree->firstWhere('id', (int) $categoryId); @endphp @section('title', $isEdit ? 'Edit article' : 'New article') @section('breadcrumbs') @endsection @section('header-actions') @if ($isEdit) View @endif @endsection @push('vendor-styles') @endpush @push('page-styles') @endpush @section('content')
@csrf @if ($isEdit) @method('PUT') @endif
{{-- ================= Main column ================= --}}
/news/{{ $article->country?->slug ?? '{country}' }}/
@error('slug')
{{ $message }}
@enderror Leave empty to generate from the title. Duplicates get a numeric suffix. @if ($isEdit && $article->published_at) Changing the slug of a published article keeps the old URL as a redirect. @endif
@error('content')
{{ $message }}
@enderror HTML is sanitised on save: scripts, inline styles and unknown embeds are removed. Video embeds are allowed from YouTube, Vimeo and Dailymotion.
{{-- Gallery --}}

Gallery / additional media

Order is preserved as selected.
@error('gallery_uploads')
{{ $message }}
@enderror @foreach ($errors->get('gallery_uploads.*') as $messages)
{{ $messages[0] }}
@endforeach
{{-- SEO --}}

SEO & social

Show / hide

All fields are optional and fall back to the title / summary / featured image.

{{-- ================= Side column ================= --}}
{{-- Publish --}}

Publish

@if ($isEdit) {{ $article->status->label() }} @endif
@if ($isEdit && $article->published_at)

First published {{ $article->published_at->format('d M Y H:i') }}

@endif @if ($canPublish)
@error('published_at')
{{ $message }}
@enderror
@error('scheduled_at')
{{ $message }}
@enderror Times are in {{ config('app.timezone') }}.
@endif @error('publish_action')
{{ $message }}
@enderror
@if ($canPublish) @else @endif
{{-- Classification --}}

Classification

@if ($canPickAuthor) @endif
@error('tags')
{{ $message }}
@enderror Type to search; press Enter to create a new tag.
{{-- Featured image --}}

Featured image

@error('featured_image_id')
{{ $message }}
@enderror
{{-- Source --}}

Source

@php $lookupData = ['categories' => $categoryTree]; $editorConfig = [ 'uploadUrl' => auth()->user()->can('create', \App\Models\Media::class) ? route('admin.media.editor-upload') : null, 'mediaUrl' => route('admin.lookup.media'), ]; @endphp @endsection @push('vendor-scripts') @endpush @push('page-scripts') @endpush