@extends('admin.layout_admin.main') @section('css') @endsection @section('content') @php $filters = []; if (request()->filled('q')) { $filters[] = 'Từ khóa: ' . e(request('q')) . ''; } if (request()->filled('status')) { $statuses = ['0' => 'Tạm ngưng', '1' => 'Hoạt động']; $filters[] = 'Trạng thái: ' . ($statuses[request('status')] ?? 'Không rõ') . ''; } @endphp
@if (count($filters)) Tìm kiếm loại thuốc @else Danh sách loại thuốc @endif
@can('them-loai-thuoc') @endcan
@if (count($filters))

Kết quả tìm kiếm: {!! implode(', ', $filters) !!}

@endif @if ($categories->count() > 0)
@can(['chinh-sua-loai-thuoc', 'xoa-loai-thuoc']) @endcan @foreach ($categories as $key => $category) @endforeach
STT Tên loại thuốc Mô tả Trạng tháiXử lý
{{ $categories->firstItem() + $key }} {{ $category->name }} ({{ $category->medicines->count() }}) {{ $category->description ?? 'Không có' }} {!! $category->status == 1 ? 'Hoạt động' : 'Tạm ngưng' !!}
@can('chinh-sua-loai-thuoc') @endcan @can('xoa-loai-thuoc')
@method('DELETE') @csrf
@endcan
@else @if (request()->has('name') && request()->input('name') != '')

Không tìm thấy loại thuốc nào cho từ khóa {{ request()->input('name') }}!

@else

Chưa có loại thuốc nào!

@endif @endif
{{ $categories->links() }}
@endsection @section('js') @endsection