@extends('backEnd.master') @section('styles') @endsection @section('mainContent') @if(isset($editData)) @lang('common.add') @endif @if(isset($editData)) @lang('common.edit') @else @lang('common.add') @endif @lang('blog.blog_category') @if(isset($editData)) {{ Form::open(['class' => 'form-horizontal', 'files' => true, 'url' => route('blog.categories.update',$editData->id), 'method' => 'PUT', 'enctype' => 'multipart/form-data']) }} @else {{ Form::open(['class' => 'form-horizontal add_form', 'files' => true, 'route' => ['blog.categories.store'], 'method' => 'POST', 'enctype' => 'multipart/form-data']) }} @endif @lang('blog.category') @lang('common.name')* @if ($errors->has('name')) {{ $errors->first('name') }} @endif @lang('blog.select_parent_category') {{__('common.select_one')}} @foreach($itemCategories as $value) parent_id==$value->id)? 'selected': '' }} @endif >-> {{ $value->name }} @foreach ($value->childs as $child_account) @include('blog::category.category_select', ['child_account' => $child_account]) @endforeach @endforeach @if ($errors->has('parent_id')) {{ $errors->first('parent_id') }} @endif {{ __('blog.image') }}* {{__("blog.image")}} @php if(permissionCheck('blog.categories.store')){ $tooltipAdd = ""; $disable = ""; }else{ $tooltipAdd = "You have no permission to add"; $disable = "disabled"; } if(permissionCheck('blog.categories.edit')){ $tooltipUpdate = ""; $disable = ""; }else{ $tooltipUpdate = "You have no permission to update"; $disable = "disabled"; } @endphp @if(isset($editData)) @if (permissionCheck('blog.categories.edit')) @lang('common.update') @else You don't have this permission @endif @else @if (permissionCheck('blog.categories.store')) @lang('common.add') @else You don't have this permission @endif @endif {{ Form::close() }} @lang('blog.blog_category') @lang('common.sl') @lang('common.image') @lang('common.category') @lang('common.action') @if(isset($itemCategories)) @php $key = 1; @endphp @foreach($itemCategories as $value) {{$key }} -> {{ $value->name }} @lang('common.select') @if (permissionCheck('blog.categories.edit')) @lang('common.edit') @endif @if (permissionCheck('blog.categories.destroy')) @lang('common.delete') @endif @lang('common.delete') @lang('common.category') @lang('common.are_you_sure_to_delete_?') @lang('common.cancel') @csrf @method('DELETE') @php $key += 1; @endphp @foreach ($value->childs as $child_account) @include('blog::category.child_category', ['child_account' => $child_account]) @php $key += 1; @endphp @endforeach @endforeach @endif @endsection @push('scripts') @endpush