*/ use HasFactory; protected $fillable = [ 'customer_id', 'vin', 'make', 'model', 'year', 'color', 'license_plate', 'engine_type', 'transmission', 'mileage', 'notes', 'status', 'last_service_date', 'vehicle_image', ]; protected $casts = [ 'last_service_date' => 'datetime', ]; public function customer(): BelongsTo { return $this->belongsTo(Customer::class); } public function serviceOrders(): HasMany { return $this->hasMany(ServiceOrder::class); } public function appointments(): HasMany { return $this->hasMany(Appointment::class); } public function inspections(): HasMany { return $this->hasMany(VehicleInspection::class); } public function getDisplayNameAttribute(): string { return "{$this->year} {$this->make} {$this->model}"; } public function getVinDisplayAttribute(): string { return strtoupper(substr($this->vin, -8)); } }