32 lines
732 B
PHP
32 lines
732 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Tenancy\HasTenant;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class WeeklyRoutePerformance extends Model
|
|
{
|
|
use HasFactory, HasTenant;
|
|
|
|
protected $table = 'weekly_route_performance';
|
|
|
|
protected $fillable = [
|
|
'tenant_id', 'week_start_date', 'route_id',
|
|
'on_time_rate_percent', 'avg_trip_duration_minutes',
|
|
'completion_rate_percent', 'trips_count',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return ['week_start_date' => 'date'];
|
|
}
|
|
|
|
public function route(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Route::class);
|
|
}
|
|
}
|