@extends('garage.layouts.app') @section('title', 'Employees') @section('content')
Employees
Manage staff (mechanics, electricians, helpers). Quick add works great for small data.
Add employee
Total
{{ ($employees ?? collect())->total() ?? count(($employees ?? [])) }}
Active
{{ ($employees ?? collect())->where('is_active', true)->count() }}
Inactive
{{ ($employees ?? collect())->where('is_active', false)->count() }}
@if(($search ?? '') || ($categoryId ?? '') || ($status ?? 'all') !== 'all') @endif
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif
@forelse(($employees ?? []) as $e) @empty @endforelse
Employee Category Salary Allowances Contact Status Actions
{{ strtoupper(mb_substr($e->name ?? '?', 0, 1)) }}
@if($e->code) Code: {{ $e->code }} @endif @if($e->join_date) · Joined {{ \Carbon\Carbon::parse($e->join_date)->format('d M Y') }} @endif
@if($e->category_name) {{ $e->category_name }} @else @endif
PKR {{ number_format($e->salary_amount ?? 0, 2) }}
{{ $e->salary_type ?? 'monthly' }}
@php $fixedTotal = (float)($e->fixed_allowance_total ?? 0); $varTotal = (float)($e->variable_allowance_total ?? 0); $varCurrent = (float)($e->variable_allowance_current_month_total ?? 0); $allowanceCount = (int)($e->allowance_count ?? 0); @endphp @if($allowanceCount > 0)
Fixed: {{ number_format($fixedTotal, 2) }}
Variable: {{ number_format($varTotal, 2) }}
This month variable: {{ number_format($varCurrent, 2) }}
@else @endif
@if($e->phone)
{{ $e->phone }}
@endif @if($e->email)
{{ $e->email }}
@endif @if(!$e->phone && !$e->email)@endif
@if($e->is_active) Active @else Inactive @endif

No employees yet

Add employee
@if(isset($employees) && method_exists($employees, 'hasPages') && $employees->hasPages())
{{ $employees->links() }}
@endif
@push('scripts') @endpush @endsection