first commit
This commit is contained in:
38
app/Models/Waypoint.php
Normal file
38
app/Models/Waypoint.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user