@extends('template.layouts.template-base') @section('title', 'Edit Vehicle') @section('styles') @endsection @section('content') Master / Edit Vehicle @csrf @method('PUT') 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 $oldVehicleIds = old('third_party_vehicle_id'); $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($oldVehicleIds) || is_array($oldVehicleTypeIds) || is_array($oldCapacities) || is_array($oldModelBrands) || is_array($oldRegistrations) || is_array($oldDeliveryTypes) || is_array($oldStatuses); if ($hasMultipleRows) { $rowCount = max( count((array) $oldVehicleIds), 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_id' => old("third_party_vehicle_id.$i"), '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 { $sourceVehicles = isset($thirdPartyVehicles) && $thirdPartyVehicles->count() ? $thirdPartyVehicles : collect([$vehicle]); foreach ($sourceVehicles as $sourceVehicle) { $vehicleRows[] = [ 'vehicle_id' => $sourceVehicle->id, 'vehicle_type_id' => $sourceVehicle->vehicle_type_id, 'capacity_kg' => $sourceVehicle->capacity_kg, 'model_brand' => $sourceVehicle->model_brand, 'registration_number' => $sourceVehicle->registration_number, 'delivery_type' => $sourceVehicle->delivery_type, 'vehicle_image' => $sourceVehicle->vehicle_image, 'status' => (string) ((int) $sourceVehicle->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 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.