@extends('admin.master') @section('title') Edit Car @endsection @section('content')

Edit Car

{!! Form::open(['route' => ['admin.cars.update', $car->id], 'method' => 'POST', 'id' => 'carForm', 'files' => true]) !!} @method('PUT')
{!! Form::label('title', 'Title', ['class' => 'form-label']) !!} * {!! Form::text('title', $car->title, [ 'class' => 'form-control form-control-sm', 'id' => 'title', 'required' => true, 'placeholder' => 'Enter Car Title', ]) !!} @error('title') {{ $message }} @enderror
{!! Form::label('slug', 'Permalink (Slug)', ['class' => 'form-label']) !!} {!! Form::text('slug', $car->slug, [ 'class' => 'form-control form-control-sm', 'id' => 'slug', 'placeholder' => 'e.g., toyota-camry-2023', ]) !!} Enter a unique URL-friendly permalink. Leave empty to auto-generate from title. @error('slug') {{ $message }} @enderror
{!! Form::label('description', 'Description', ['class' => 'form-label']) !!}
{!! Form::textarea('description', $car->description, [ 'class' => 'form-control form-control-sm', 'id' => 'description', 'rows' => 10, 'placeholder' => 'Enter Car Description', ]) !!} @error('description') {{ $message }} @enderror

SEO Details
{!! Form::label('meta_title', 'Meta Title', ['class' => 'form-label']) !!} {!! Form::text('meta_title', $car->meta_title, [ 'class' => 'form-control form-control-sm', 'id' => 'meta_title', 'placeholder' => 'Enter Meta Title', 'maxlength' => 255, ]) !!} Recommended: 50-60 characters @error('meta_title') {{ $message }} @enderror
{!! Form::label('meta_description', 'Meta Description', ['class' => 'form-label']) !!} {!! Form::textarea('meta_description', $car->meta_description, [ 'class' => 'form-control form-control-sm', 'id' => 'meta_description', 'rows' => 3, 'placeholder' => 'Enter Meta Description', 'maxlength' => 500, ]) !!} Recommended: 150-160 characters @error('meta_description') {{ $message }} @enderror
{!! Form::label('meta_keywords', 'Meta Keywords', ['class' => 'form-label']) !!} {!! Form::textarea('meta_keywords', $car->meta_keywords, [ 'class' => 'form-control form-control-sm', 'id' => 'meta_keywords', 'rows' => 2, 'placeholder' => 'Enter Meta Keywords (comma separated)', 'maxlength' => 500, ]) !!} Separate keywords with commas @error('meta_keywords') {{ $message }} @enderror

{!! Form::label('brand_id', 'Brand', ['class' => 'form-label']) !!} * {!! Form::select('brand_id', ['' => 'Select Brand'] + $brands->pluck('brand_name', 'id')->toArray(), $car->brand_id, [ 'class' => 'form-select form-select-sm select2', 'id' => 'brand_id', 'required' => true, ]) !!} @error('brand_id') {{ $message }} @enderror
{!! Form::label('car_model_id', 'Car Model', ['class' => 'form-label']) !!} * {!! Form::select('car_model_id', ['' => 'Select Car Model'] + $carModels->pluck('model_name', 'id')->toArray(), $car->car_model_id, [ 'class' => 'form-select form-select-sm select2', 'id' => 'car_model_id', 'required' => true, ]) !!} @error('car_model_id') {{ $message }} @enderror
{!! Form::label('fuel_type_id', 'Fuel Type', ['class' => 'form-label']) !!} * {!! Form::select('fuel_type_id', ['' => 'Select Fuel Type'] + $fuelTypes->pluck('fuel_type_name', 'id')->toArray(), $car->fuel_type_id, [ 'class' => 'form-select form-select-sm select2', 'id' => 'fuel_type_id', 'required' => true, ]) !!} @error('fuel_type_id') {{ $message }} @enderror
{!! Form::label('body_type_id', 'Body Type', ['class' => 'form-label']) !!} * {!! Form::select('body_type_id', ['' => 'Select Body Type'] + $bodyTypes->pluck('body_type_name', 'id')->toArray(), $car->body_type_id, [ 'class' => 'form-select form-select-sm select2', 'id' => 'body_type_id', 'required' => true, ]) !!} @error('body_type_id') {{ $message }} @enderror
{!! Form::label('transmission_id', 'Transmission', ['class' => 'form-label']) !!} * {!! Form::select('transmission_id', ['' => 'Select Transmission'] + $transmissions->pluck('transmission_name', 'id')->toArray(), $car->transmission_id, [ 'class' => 'form-select form-select-sm select2', 'id' => 'transmission_id', 'required' => true, ]) !!} @error('transmission_id') {{ $message }} @enderror
{!! Form::label('ownership_id', 'Ownership', ['class' => 'form-label']) !!} * {!! Form::select('ownership_id', ['' => 'Select Ownership'] + $ownerships->pluck('ownership_name', 'id')->toArray(), $car->ownership_id, [ 'class' => 'form-select form-select-sm select2', 'id' => 'ownership_id', 'required' => true, ]) !!} @error('ownership_id') {{ $message }} @enderror
{!! Form::label('seater_id', 'Seater', ['class' => 'form-label']) !!} * {!! Form::select('seater_id', ['' => 'Select Seater'] + $seaters->pluck('seater_name', 'id')->toArray(), $car->seater_id, [ 'class' => 'form-select form-select-sm select2', 'id' => 'seater_id', 'required' => true, ]) !!} @error('seater_id') {{ $message }} @enderror
{!! Form::label('color_id', 'Color', ['class' => 'form-label']) !!} * {!! Form::select('color_id', ['' => 'Select Color'] + $colors->pluck('color_name', 'id')->toArray(), $car->color_id, [ 'class' => 'form-select form-select-sm select2', 'id' => 'color_id', 'required' => true, ]) !!} @error('color_id') {{ $message }} @enderror
{!! Form::label('engine_type_id', 'Engine Type', ['class' => 'form-label']) !!} * {!! Form::select('engine_type_id', ['' => 'Select Engine Type'] + $engineTypes->pluck('engine_type_name', 'id')->toArray(), $car->engine_type_id, [ 'class' => 'form-select form-select-sm select2', 'id' => 'engine_type_id', 'required' => true, ]) !!} @error('engine_type_id') {{ $message }} @enderror
{!! Form::label('year', 'Year', ['class' => 'form-label']) !!} {!! Form::number('year', $car->year, [ 'class' => 'form-control form-control-sm', 'id' => 'year', 'min' => '1900', 'max' => date('Y') + 1, 'placeholder' => 'Enter Year', ]) !!} @error('year') {{ $message }} @enderror
{!! Form::label('price', 'Price', ['class' => 'form-label']) !!} {!! Form::number('price', $car->price, [ 'class' => 'form-control form-control-sm', 'id' => 'price', 'step' => '0.01', 'min' => '0', 'placeholder' => 'Enter Price', ]) !!} @error('price') {{ $message }} @enderror
{!! Form::label('km_driven', 'KM Driven', ['class' => 'form-label']) !!} {!! Form::text('km_driven', $car->km_driven, [ 'class' => 'form-control form-control-sm', 'id' => 'km_driven', 'placeholder' => 'Enter KM Driven', ]) !!} @error('km_driven') {{ $message }} @enderror
{!! Form::label('registration_number', 'Registration Number', ['class' => 'form-label']) !!} {!! Form::text('registration_number', $car->registration_number, [ 'class' => 'form-control form-control-sm', 'id' => 'registration_number', 'placeholder' => 'Enter Registration Number', ]) !!} @error('registration_number') {{ $message }} @enderror
{!! Form::label('registration_year', 'Registration Year', ['class' => 'form-label']) !!} {!! Form::text('registration_year', $car->registration_year, [ 'class' => 'form-control form-control-sm', 'id' => 'registration_year', 'placeholder' => 'Enter Registration Year', ]) !!} @error('registration_year') {{ $message }} @enderror
{!! Form::label('insurance_validity', 'Insurance Validity', ['class' => 'form-label']) !!} {!! Form::text('insurance_validity', $car->insurance_validity, [ 'class' => 'form-control form-control-sm', 'id' => 'insurance_validity', 'placeholder' => 'Enter Insurance Validity', ]) !!} @error('insurance_validity') {{ $message }} @enderror
{!! Form::label('rc_status', 'RC Status', ['class' => 'form-label']) !!} {!! Form::text('rc_status', $car->rc_status, [ 'class' => 'form-control form-control-sm', 'id' => 'rc_status', 'placeholder' => 'Enter RC Status', ]) !!} @error('rc_status') {{ $message }} @enderror
{!! Form::label('main_image', 'Main Image', ['class' => 'form-label']) !!} {!! Form::file('main_image', [ 'class' => 'form-control form-control-sm', 'id' => 'main_image', 'accept' => 'image/jpeg,image/png,image/jpg,image/gif,image/webp', ]) !!} Accepted formats: JPEG, PNG, JPG, GIF, WEBP (Max: 5MB). Leave empty to keep current image. @if($car->main_image)
Current Main Image
@endif
@error('main_image') {{ $message }} @enderror
{!! Form::label('gallery_images', 'Gallery Images', ['class' => 'form-label']) !!} Accepted formats: JPEG, PNG, JPG, GIF, WEBP (Max: 5MB per image). You can select multiple images. New images will be added to existing gallery. @if($car->carImages && $car->carImages->count() > 0)
@foreach($car->carImages as $carImage) @endforeach
@endif @error('gallery_images') {{ $message }} @enderror @error('gallery_images.*') {{ $message }} @enderror
Cancel
{!! Form::close() !!}
@endsection @section('css') @endsection @section('javascript') @endsection