@extends('backend.layouts.app') @section('title', \App\Http\Helpers\MenuHelper::getPageTitle()) @section('content') @include('backend.module._index-reset-button')

All Departments

@can('content-directory-department.import') Import @endcan @can('content-directory-department.create') Create @endcan
@if (filled($parentFilter ?? null) || filled($search ?? null)) Reset @endif
@if($filterActive && count($departments) <= 1)
Only 1 record found. Add more records to enable drag & drop sorting.
@endif @if(!$filterActive)
Use the Parent filter above to view departments under a specific parent, then drag & drop to reorder.
@endif @if(!$filterActive)
@endif
@forelse($departments as $department) @php $depth = $department->depth ?? 0; @endphp @php $guides = $department->tree_guides ?? []; $treeDepth = min($depth, 6); @endphp @empty @endforelse
# Code Name (BM) Name (EN) Parent Actions
@for($level = 0; $level < $treeDepth; $level++) @if($level === $treeDepth - 1) @unless($department->is_last_child) @endunless @elseif(!empty($guides[$level + 1])) @endif @endfor
@if(!$filterActive) @if($department->has_children) @else @endif @endif @if($filterActive && count($departments) > 1) @elseif($filterActive && count($departments) <= 1) @else @endif {{ $filterActive ? ($departments->currentPage() - 1) * $departments->perPage() + $loop->iteration : $department->display_sort }}
{{ $department->directory_department_code ?? '-' }} {{ $department->directory_department_name ?? '-' }} {{ $department->directory_department_name_en ?? '-' }} {{ $department->parent_name ?? $department->parent?->directory_department_name ?? '—' }}
@can('content-directory-department.update') @endcan @can('content-directory-department.delete')
@csrf @method('DELETE')
@endcan

No departments found

Click "Create" to add your first entry.

@if($filterActive)
{{ $departments->appends(request()->query())->links('vendor.pagination.custom') }}
@elseif($rootPaginator && $rootPaginator->hasPages())

Showing root departments {{ $rootPaginator->firstItem() }}–{{ $rootPaginator->lastItem() }} of {{ $rootPaginator->total() }}

{{ $rootPaginator->appends(request()->query())->links('vendor.pagination.custom') }}
@endif
@endsection @push('styles') @endpush @push('scripts') @endpush