{!! Form::label('title', 'Title', ['class' => 'col-md-2 control-label']) !!}
{!! Form::text('title', null, ['class' => 'form-control', 'required', 'autofocus']) !!} {{ $errors->first('title') }}
{!! Form::label('image', 'Image', ['class' => 'col-md-2 control-label']) !!}
{!! Form::file('image', null, ['class' => 'form-control', '', 'autofocus']) !!} @if(isset($post->image) && $post->image != '') @endif {{ $errors->first('image') }}
{!! Form::label('body', 'Body', ['class' => 'col-md-2 control-label']) !!}
{!! Form::textarea('body', null, ['class' => 'ckeditor form-control', 'required']) !!} {{ $errors->first('body') }}
{!! Form::label('is_popular', 'Popular', ['class' => 'col-md-2 control-label']) !!}
@if(isset($post->is_popular) && $post->is_popular == 0) {!! Form::checkbox('is_popular', null, null) !!} @else {!! Form::checkbox('is_popular', null) !!} @endif {{ $errors->first('is_popular') }}
{!! Form::label('is_trending', 'Trending', ['class' => 'col-md-2 control-label']) !!}
@if(isset($post->is_trending) && $post->is_trending == 0) {!! Form::checkbox('is_trending', null, null) !!} @else {!! Form::checkbox('is_trending', null) !!} @endif {{ $errors->first('is_trending') }}
{!! Form::label('category_id', 'Category', ['class' => 'col-md-2 control-label']) !!}
{!! Form::select('category_id', $categories, null, ['class' => 'form-control', 'required']) !!} {{ $errors->first('category_id') }}
@php if(isset($post)) { $tag = $post->tags->pluck('name')->all(); } else { $tag = null; } @endphp
{!! Form::label('tags', 'Tag', ['class' => 'col-md-2 control-label']) !!}
{!! Form::select('tags[]', $tags, $tag, ['class' => 'form-control select2-tags', 'required', 'multiple']) !!} {{ $errors->first('tags') }}