first commit

This commit is contained in:
furen81
2026-01-23 19:18:52 +07:00
commit 6e681c4ad3
80 changed files with 13874 additions and 0 deletions

42
app/Models/PlanTarget.php Normal file
View 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);
}
}