Files
GLOC/app/Models/Waypoint.php
2026-01-23 19:18:52 +07:00

39 lines
752 B
PHP

<?php
namespace App\Models;
use MongoDB\Laravel\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Waypoint extends Model
{
protected $fillable = [
'sales_route_id',
'type',
'latitude',
'longitude',
'recorded_at',
'location_name',
'address',
'notes',
'photo_url',
];
protected function casts(): array
{
return [
'latitude' => 'decimal:8',
'longitude' => 'decimal:8',
'recorded_at' => 'datetime',
];
}
/**
* Get the sales route that owns the waypoint.
*/
public function salesRoute(): BelongsTo
{
return $this->belongsTo(SalesRoute::class);
}
}