2026-05-07 23:31:33 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
|
|
class ProgressUpdate extends Model
|
|
|
|
|
{
|
|
|
|
|
protected $fillable = [
|
2026-06-18 09:05:20 +02:00
|
|
|
'uuid', 'phase_id', 'user_id', 'progress_percent', 'comment', 'location', 'client_updated_at'
|
2026-05-07 23:31:33 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
protected $casts = [
|
|
|
|
|
'location' => 'array', // Store as [lat, lng]
|
2026-06-18 09:05:20 +02:00
|
|
|
'client_updated_at' => 'datetime',
|
2026-05-07 23:31:33 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
public function phase()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(Phase::class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function user()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(User::class);
|
|
|
|
|
}
|
|
|
|
|
}
|