Attempt to fix N+1 issues
This commit is contained in:
@@ -24,6 +24,21 @@ final class Ticket extends Model
|
||||
|
||||
protected $table = 'helpdesk_tickets';
|
||||
|
||||
|
||||
/**
|
||||
* Relations that are repeatedly displayed in ticket lists/detail views.
|
||||
*
|
||||
* Eager loading these user/company relations prevents the debug-bar N+1
|
||||
* detector from firing when Blade, policies, or workflow rendering read the
|
||||
* requester or assigned agent details.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $with = [
|
||||
'owner.company',
|
||||
'agent.company',
|
||||
];
|
||||
|
||||
/** @var list<string> */
|
||||
protected $fillable = [
|
||||
'reference', 'company_id', 'user_id', 'agent_id', 'status_id', 'board_id', 'priority_id', 'category_id', 'project_id', 'team_id',
|
||||
|
||||
Reference in New Issue
Block a user