first commit
This commit is contained in:
42
app/Models/PlanTarget.php
Normal file
42
app/Models/PlanTarget.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use MongoDB\Laravel\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class PlanTarget extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'sales_plan_id',
|
||||
'order',
|
||||
'latitude',
|
||||
'longitude',
|
||||
'name',
|
||||
'address',
|
||||
'phone',
|
||||
'notes',
|
||||
'estimated_duration_minutes',
|
||||
'is_completed',
|
||||
'completed_at',
|
||||
'source', // 'admin', 'mobile_manual', etc.
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'latitude' => 'decimal:8',
|
||||
'longitude' => 'decimal:8',
|
||||
'is_completed' => 'boolean',
|
||||
'completed_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the sales plan that owns the target.
|
||||
*/
|
||||
public function salesPlan(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(SalesPlan::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user