'date', 'total_distance_km' => 'decimal:2', 'started_at' => 'datetime', 'ended_at' => 'datetime', ]; } /** * Get the user that owns the route. */ public function user(): BelongsTo { return $this->belongsTo(User::class); } /** * Get the waypoints for the route. */ public function waypoints(): HasMany { return $this->hasMany(Waypoint::class)->orderBy('recorded_at'); } }