42 lines
969 B
PHP
42 lines
969 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
|
|
|
|
|
class MaintenanceSchedule extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'vehicle_id',
|
|
'name',
|
|
'description',
|
|
'mileage_interval',
|
|
'day_interval',
|
|
'last_performed',
|
|
'last_mileage',
|
|
'next_due_date',
|
|
'next_due_mileage',
|
|
'is_active',
|
|
];
|
|
|
|
protected $casts = [
|
|
'last_performed' => 'date',
|
|
'next_due_date' => 'date',
|
|
'is_active' => 'boolean',
|
|
];
|
|
|
|
public function vehicle(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Vehicle::class);
|
|
}
|
|
}
|