Changes 0228092025 Laptop
This commit is contained in:
+25
-4
@@ -5,21 +5,32 @@
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class FieldJob extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use SoftDeletes;
|
||||
|
||||
protected $fillable = [
|
||||
'field_job_setting_id',
|
||||
'asigned_user_id',
|
||||
'start_date',
|
||||
'end_date',
|
||||
'user_id',
|
||||
'contract_id',
|
||||
'assigned_at',
|
||||
'completed_at',
|
||||
'cancelled_at',
|
||||
'priority',
|
||||
'notes',
|
||||
'address_snapshot ',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'start_date' => 'date',
|
||||
'end_date' => 'date',
|
||||
'assigned_at' => 'date',
|
||||
'completed_at' => 'date',
|
||||
'cancelled_at' => 'date',
|
||||
'priority' => 'boolean',
|
||||
'address_snapshot ' => 'array',
|
||||
];
|
||||
|
||||
protected static function booted(){
|
||||
@@ -39,4 +50,14 @@ public function assignedUser(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'asigned_user_id');
|
||||
}
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
}
|
||||
|
||||
public function contract(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Contract::class, 'contract_id');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user