<?php $__env->startSection('title', 'Vehicles'); ?>
<?php $__env->startSection('page_title', 'Vehicles & Drivers'); ?>
<?php $__env->startSection('breadcrumbs'); ?>
    <li class="breadcrumb-item"><a href="<?php echo e(route('dashboard')); ?>">Home</a></li><li class="breadcrumb-item active">Vehicles</li>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('page_actions'); ?>
    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('transport.create')): ?><a href="<?php echo e(route('vehicles.create')); ?>" class="btn btn-primary"><i class="bi bi-plus-lg me-1"></i>Add Vehicle</a><?php endif; ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <div class="card"><div class="card-body">
        <table class="table table-hover align-middle">
            <thead><tr><th>Registration</th><th>Model</th><th class="text-center">Capacity</th><th>Driver</th><th>Phone</th><th>Route</th><th class="text-center">Status</th><th class="text-end">Actions</th></tr></thead>
            <tbody>
                <?php $__empty_1 = true; $__currentLoopData = $vehicles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $v): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <tr>
                        <td class="fw-semibold"><?php echo e($v->registration_no); ?></td>
                        <td><?php echo e($v->model ?: '—'); ?></td>
                        <td class="text-center"><?php echo e($v->capacity ?: '—'); ?></td>
                        <td><?php echo e($v->driver_name ?: '—'); ?></td>
                        <td class="small"><?php echo e($v->driver_phone ?: '—'); ?></td>
                        <td class="small"><?php echo e($v->route?->name ?? '—'); ?></td>
                        <td class="text-center"><?php if($v->is_active): ?><span class="badge bg-soft-success">Active</span><?php else: ?><span class="badge bg-soft-danger">Inactive</span><?php endif; ?></td>
                        <td class="text-end">
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('transport.update')): ?><a href="<?php echo e(route('vehicles.edit', $v)); ?>" class="btn btn-sm btn-light border"><i class="bi bi-pencil"></i></a><?php endif; ?>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('transport.delete')): ?><form method="POST" action="<?php echo e(route('vehicles.destroy', $v)); ?>" class="d-inline" data-confirm="Delete vehicle?"><?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?><button class="btn btn-sm btn-light border text-danger"><i class="bi bi-trash"></i></button></form><?php endif; ?>
                        </td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <tr><td colspan="8" class="text-center text-muted py-4">No vehicles yet.</td></tr>
                <?php endif; ?>
            </tbody>
        </table>
    </div></div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/u385418287/domains/itartificer.com/public_html/sms-erp/resources/views/transport/vehicles/index.blade.php ENDPATH**/ ?>