@extends('layouts.backend') @section('content')

{{ __('Departments') }}

@if(auth()->user()?->hasPermission('department.create')) {{ __('Add Department') }} @endif
@include('partials.flash')
{{ __('Reset') }}
@forelse($departments as $department) @empty @endforelse
{{ __('Name') }} {{ __('Code') }} {{ __('Head') }} {{ __('Employees') }} {{ __('Designations') }} {{ __('Status') }} {{ __('Actions') }}
{{ $department->name }} {{ $department->code ?: '-' }} @if($department->head) {{ trim($department->head->first_name.' '.$department->head->last_name) }}
{{ $department->head->employee_code }}
@else - @endif
{{ $department->employees_count }} {{ $department->designations_count }} @if($department->is_active) {{ __('Active') }} @else {{ __('Inactive') }} @endif @if(auth()->user()?->hasPermission('department.update')) @endif @if(auth()->user()?->hasPermission('department.delete'))
@csrf @method('DELETE')
@endif
{{ __('No departments found.') }}
{{ $departments->links('pagination::bootstrap-5') }}
@endsection