@extends('template.layouts.template-base') @section('title', 'Add Vehicle') @section('styles') @endsection @section('content') Master / Add Vehicle @csrf Basic Information Vehicle Owner * Company Third Party Transporter Name * Contact Number * +91 Vehicle Number * Pincode * City State Building No / Colony / Area / Street * Service / Maintenance Due Date Notes {{ old('notes', $transporter?->notes ?? $vehicle->notes) }} Vehicle Information @php $oldVehicleTypeIds = old('vehicle_type_id'); $oldCapacities = old('capacity_kg'); $oldModelBrands = old('model_brand'); $oldRegistrations = old('registration_number'); $oldDeliveryTypes = old('delivery_type'); $oldStatuses = old('status'); $vehicleRows = []; $hasMultipleRows = is_array($oldVehicleTypeIds) || is_array($oldCapacities) || is_array($oldModelBrands) || is_array($oldRegistrations) || is_array($oldDeliveryTypes) || is_array($oldStatuses); if ($hasMultipleRows) { $rowCount = max( count((array) $oldVehicleTypeIds), count((array) $oldCapacities), count((array) $oldModelBrands), count((array) $oldRegistrations), count((array) $oldDeliveryTypes), count((array) $oldStatuses), 1 ); for ($i = 0; $i < $rowCount; $i++) { $vehicleRows[] = [ 'vehicle_type_id' => old("vehicle_type_id.$i"), 'capacity_kg' => old("capacity_kg.$i"), 'model_brand' => old("model_brand.$i"), 'registration_number' => old("registration_number.$i"), 'delivery_type' => old("delivery_type.$i"), 'vehicle_image' => null, 'status' => (string) old("status.$i", '1'), ]; } } else { $vehicleRows[] = [ 'vehicle_type_id' => old('vehicle_type_id', $vehicle->vehicle_type_id), 'capacity_kg' => old('capacity_kg', $vehicle->capacity_kg), 'model_brand' => old('model_brand', $vehicle->model_brand), 'registration_number' => old('registration_number', $vehicle->registration_number), 'delivery_type' => old('delivery_type', $vehicle->delivery_type), 'vehicle_image' => old('vehicle_image', $vehicle->vehicle_image), 'status' => (string) old('status', (int) $vehicle->status), ]; } @endphp @foreach ($vehicleRows as $index => $row) Vehicle {{ $index + 1 }} Remove Vehicle Type * Select Vehicle Type @foreach ($vehicleTypes as $vehicleType) id ? 'selected' : '' }}> {{ $vehicleType->name }} @endforeach Capacity Kg Vehicle Model & Brand Registration Number * Delivery Type * Delivery Type National Local Both Status * Active Inactive Vehicle Image Upload @endforeach Vehicle __ROW_NUMBER__ * Vehicle Type * Select Vehicle Type @foreach ($vehicleTypes as $vehicleType) {{ $vehicleType->name }} @endforeach Capacity Kg Vehicle Model & Brand Registration Number * Delivery Type * Delivery Type National Local Both Status * Active Inactive Vehicle Image Upload Add More + Cancel Save
Are you sure you want to delete role name? These role name will be permanently removed from the roles list. This action cannot be undone. If any users are assigned to this role, you must reassign them before deleting.
These roles has been deleted successfully.
The vehicle has been created successfully.