hasMany('App\Model\helpdesk\Ticket\Ticket_attachments',); // // } public function thread() { return $this->hasMany('App\Model\helpdesk\Ticket\Ticket_Thread', 'ticket_id'); } public function collaborator() { return $this->hasMany('App\Model\helpdesk\Ticket\Ticket_Collaborator', 'ticket_id'); } public function formdata() { return $this->hasMany('App\Model\helpdesk\Ticket\Ticket_Form_Data', 'ticket_id'); } public function delete() { $this->thread()->delete(); $this->collaborator()->delete(); $this->formdata()->delete(); parent::delete(); } }