@extends('admin/layouts/admin') @section('title', $item->exists ? __('idea::lang.admin.posts.edit') : __('idea::lang.admin.posts.create')) @section('content')
@include('admin/shared/alerts')
@csrf @if($item->exists) @method('PUT') @endif

{{ $item->exists ? __('idea::lang.admin.posts.edit') : __('idea::lang.admin.posts.create') }}

{{ __('idea::lang.admin.posts.description') }}

@include('admin/shared/input', ['name' => 'title', 'label' => __('global.title'), 'value' => old('title', $item->title)])
@include('admin/shared/input', ['name' => 'slug', 'label' => __('global.slug'), 'value' => old('slug', $item->slug)])
@include('admin/shared/select', ['name' => 'status', 'label' => __('global.status'), 'options' => $statuses, 'value' => old('status', $item->status ?: 'open')])
@include('admin/shared/textarea', ['name' => 'description', 'label' => __('global.content'), 'value' => old('description', $item->description), 'rows' => 8])
@include('admin/shared/textarea', ['name' => 'response', 'label' => __('idea::lang.official_response'), 'value' => old('response', $item->response), 'rows' => 5])
@if($tags->count() > 0)
@foreach($tags as $tag) @include('admin/shared/checkbox', ['name' => 'tags[]', 'label' => $tag->name, 'value' => $tag->id, 'checked' => in_array($tag->id, old('tags', $item->tags->pluck('id')->all()))]) @endforeach
@endif
@endsection