Attempt to fix N+1 issues still there and more now
This commit is contained in:
@@ -35,6 +35,7 @@ final class Ticket extends Model
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $with = [
|
||||
'user.company',
|
||||
'owner.company',
|
||||
'agent.company',
|
||||
];
|
||||
@@ -67,6 +68,13 @@ final class Ticket extends Model
|
||||
'time_spent_minutes' => 'integer',
|
||||
];
|
||||
|
||||
|
||||
/** @return BelongsTo<User, Ticket> */
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
}
|
||||
|
||||
/** @return BelongsTo<User, Ticket> */
|
||||
public function owner(): BelongsTo
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user