@php $isAddType = $data['type'] == 'Add'; $isEditTypeWithParent = $data['type'] == 'Edit' && isset($data['category']) && $data['category']->parent_id == null; @endphp
{!! Form::label('name', __('labels.category.form.name')) !!} * {!! Form::text('name', old('name', $data['category']->name ?? ''), ['id' => 'name', 'required', 'class' => 'form-control']) !!} @if ($errors->has('name'))
{{ $errors->first('name') }}
@endif
{!! Form::label('parent_id', __('labels.category.form.parent')) !!} {!! Form::select('parent_id', ['' => '-- None --'] + $data['categories']->pluck('name', 'id')->toArray(), old('parent_id', $data['category']->parent_id ?? ''), ['id' => 'parent_id', 'class' => 'form-control'] ) !!} @if ($errors->has('slug'))
{{ $errors->first('slug') }}
@endif
{!! Form::label('description', __('labels.category.form.description')) !!} {!! Form::textarea('description', old('description', $data['category']->description ?? ''), ['id' => 'description', 'class' => 'form-control']) !!} @if ($errors->has('description'))
{{ $errors->first('description') }}
@endif
@if ($isAddType || $isEditTypeWithParent)
{{Form::label('logo', __('labels.category.form.logo'))}}* @if ($errors->has('logo'))
{{ $errors->first('logo') }}
@endif
{{Form::label('banner_image', __('labels.category.form.banner'))}}* @if ($errors->has('banner_image'))
{{ $errors->first('banner_image') }}
@endif
@endif
{!! Form::label('is_active', __('labels.category.form.active')) !!} {!! Form::checkbox('is_active', 1, old('is_active', $data['category']->is_active ?? 1), ['id' => 'is_active']) !!} @if ($errors->has('description'))
{{ $errors->first('description') }}
@endif
@if ($isAddType || $isEditTypeWithParent)
{!! Form::label('is_featured', __('labels.category.form.feature')) !!} {!! Form::checkbox('is_featured', 1, old('is_featured', $data['category']->is_featured ?? 1), ['id' => 'is_featured']) !!} @if ($errors->has('is_featured'))
{{ $errors->first('is_featured') }}
@endif
@endif
{{ __('Meta Details') }}
{{__('labels.product.form.meta_title')}} {!! Form::text('meta_title', old('meta_title', isset($data['category']) && $data['category']->meta_title ? $data['category']->meta_title : ''), ['class' => 'form-control editor-text', 'id'=>'meta_title']) !!}
{{__('labels.product.form.meta_description')}} {!! Form::textarea('meta_description', old('meta_description', isset($data['category']) && $data['category']->meta_description ? $data['category']->meta_description : ''), ['class' => 'form-control editor-text', 'id'=>'meta_description']) !!}