- 법인차량 CRUD (CorporateVehicle) - 차량 운행일지 CRUD (VehicleLog) - 차량 정비이력 CRUD (VehicleMaintenance) - 모델, 서비스, 컨트롤러, 라우트 구성 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
41 lines
874 B
PHP
41 lines
874 B
PHP
<?php
|
|
|
|
namespace App\Models\Tenants;
|
|
|
|
use App\Traits\BelongsToTenant;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class VehicleLog extends Model
|
|
{
|
|
use BelongsToTenant, SoftDeletes;
|
|
|
|
protected $fillable = [
|
|
'tenant_id',
|
|
'vehicle_id',
|
|
'log_date',
|
|
'department',
|
|
'driver_name',
|
|
'trip_type',
|
|
'departure_type',
|
|
'departure_name',
|
|
'departure_address',
|
|
'arrival_type',
|
|
'arrival_name',
|
|
'arrival_address',
|
|
'distance_km',
|
|
'note',
|
|
];
|
|
|
|
protected $casts = [
|
|
'vehicle_id' => 'integer',
|
|
'distance_km' => 'integer',
|
|
];
|
|
|
|
public function vehicle(): BelongsTo
|
|
{
|
|
return $this->belongsTo(CorporateVehicle::class, 'vehicle_id');
|
|
}
|
|
}
|