big update all menus
This commit is contained in:
@@ -13,6 +13,7 @@ class Ticket extends Model
|
||||
'ticket_no',
|
||||
'ticket_type_id',
|
||||
'customer_id',
|
||||
'source','installation_step','verified_by','verified_at','verification_notes',
|
||||
'title',
|
||||
'description',
|
||||
'priority',
|
||||
@@ -26,8 +27,19 @@ class Ticket extends Model
|
||||
'rejection_reason',
|
||||
'resolved_at',
|
||||
'closed_at',
|
||||
'tenant_id',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'assigned_at' => 'datetime',
|
||||
'resolved_at' => 'datetime',
|
||||
'closed_at' => 'datetime',
|
||||
'verified_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Relationships
|
||||
@@ -41,4 +53,13 @@ class Ticket extends Model
|
||||
'ticket_type_id'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function customer() { return $this->belongsTo(Customer::class); }
|
||||
public function tenant() { return $this->belongsTo(Tenant::class); }
|
||||
public function creator() { return $this->belongsTo(User::class, 'created_by'); }
|
||||
public function assignments() { return $this->hasMany(TicketAssignment::class); }
|
||||
public function logs() { return $this->hasMany(TicketLog::class)->orderByDesc('id'); }
|
||||
public function materials() { return $this->hasMany(TicketMaterial::class)->with('user:id,name')->orderByDesc('id'); }
|
||||
public function attachments() { return $this->hasMany(TicketAttachment::class)->with('file:id,uuid,original_name,mime_type,size')->orderBy('id'); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user