@extends('backend.layouts_backend.master2') @section('title') All Units @endsection @section('content') {{-- header --}}

All Units

@if (Auth::user()->can('unit-create')) @endif @if (Auth::user()->can('unit-inactive')) @endif
{{-- end header --}}
{{-- alert add item --}} @if (session('messagesave')) {{--
{{ session('message')}}
--}} @endif {{-- alert delete item --}} @if (session('messagedelete')) {{--
{{ session('messagedelete')}}
--}} @endif {{-- alert update item --}} @if (session('messageupdate')) @endif
@foreach ($units as $key => $unit) @endforeach
#Id Unit Name Unit Status Registered On Use Status Created By Action
{{ $key + 1 ?? 'N/A' }} {{ $unit->unit_name ?? 'N/A' }} @if ($unit->unit_status == 1) {{ get_status_message($unit->unit_status) ?? '' }} @elseif($unit->unit_status == 2) {{ get_status_message($unit->unit_status) ?? '' }} @else No Status @endif {{ short_date($unit->created_at) ?? 'N/A' }} @php $unitInUse = $unit->products()->exists(); @endphp @if ($unitInUse) In Use @else Not In Use @endif {{ get_user_fullname_temporary($unit->created_by) ?? 'N/A' }}
@if (Auth::user()->can('unit-edit')) @endif @if (Auth::user()->can('unit-delete')) @if (!$unitInUse)
@csrf @method('DELETE')
@endif @endif

@endsection