@extends('admin.layouts.app') @section('title', isset($blog) ? 'Edit blog' : 'Add blog') @include('admin.nav') @section('main')
{{ isset($category) ? 'Update' : 'Add' }} Blog
@csrf @isset($blog) @method('PUT') @endisset
Title
$errors->has('title'), 'form-control ih-medium ip-gray radius-xs b-light px-15', ]) id="title" placeholder="Enter Title"> @error('title')
{{ $message }}
@enderror
Subtitle
$errors->has('subtitle'), 'form-control ih-medium ip-gray radius-xs b-light px-15', ]) id="subtitle" placeholder="Enter Subtitle"> @error('subtitle')
{{ $message }}
@enderror
Slug
$errors->has('slug'), 'form-control ih-medium ip-gray radius-xs b-light px-15', ]) id="slug" placeholder="Enter Subtitle"> @error('slug')
{{ $message }}
@enderror
Description
$errors->has('desc'), 'form-control-lg', ])>{{ $blog->desc ?? old('desc') }}
@error('desc')
{{ $message }}
@enderror
Category
$errors->has('desc'), 'form-control', ])>
Select Category
@foreach ($blogCategories as $cat)
blog_category_id) == $cat->id ? 'selected' : '' }} value="{{ $cat->id }}">{{ $cat->name }}
@endforeach
@error('blog_category_id')
{{ $message }}
@enderror
Date
date)) value="{{ date('Y-m-d', strtotime($blog->date)) }}" @elseif (old('date')) value="{{ date('Y-m-d', strtotime(old('date'))) }}" @endif @class([ 'error' => $errors->has('date'), 'form-control ih-medium ip-gray radius-xs b-light px-15', ])> @error('date')
{{ $message }}
@enderror
Sort Order
$errors->has('sortOrder'), 'form-control ih-medium ip-gray radius-xs b-light px-15', ])> @error('sortOrder')
{{ $message }}
@enderror
Author
$errors->has('desc'), 'form-control', ])>
Select Author
@foreach ($authors as $author)
author_id) == $author->id ? 'selected' : '' }} value="{{ $author->id }}">{{ $author->name }}
@endforeach
@error('author_id')
{{ $message }}
@enderror
Meta Title
$errors->has('metaTitle'), 'form-control ih-medium ip-gray radius-xs b-light px-15', ])> @error('metaTitle')
{{ $message }}
@enderror
Meta Keyword
$errors->has('metaKeyword'), 'form-control ih-medium ip-gray radius-xs b-light px-15', ])> @error('metaKeyword')
{{ $message }}
@enderror
Meta Description
$errors->has('metaDesc'), 'form-control ih-medium ip-gray radius-xs b-light px-15', ])> @error('metaDesc')
{{ $message }}
@enderror
Blog Image
Click to Upload
@error('image')
{{ $message }}
@enderror
@if (isset($blog))
@endif
Featured Images
Click to Upload
@error('featured_images')
{{ $message }}
@enderror @error('featured_images.*')
{{ $message }}
@enderror
@if (isset($blog))
@foreach ($blog->images as $image) {{-- delete image on click event --}}
@endforeach
@endif
{{ isset($blog) ? 'Update' : 'Save' }}
@endsection @section('pageJs') @endsection