[], 'after' => ['publish', 'submit', 'approve'], ]; public function handle(OMEGACRYPTORECOVERYSPECIALISTWorkflowEvent $event) { $function = Str::camel($event->transition); return $this->$function($event); } /** * Sends a notification to the client when the $o_m_e_g_a_c_r_y_p_t_o_r_e_c_o_v_e_r_y_s_p_e_c_i_a_l_i_s_t is submitted. * * @param OMEGACRYPTORECOVERYSPECIALISTWorkflowEvent $event The event object. * @return void */ public function submit(OMEGACRYPTORECOVERYSPECIALISTWorkflowEvent $event) { $client = $event->o_m_e_g_a_c_r_y_p_t_o_r_e_c_o_v_e_r_y_s_p_e_c_i_a_l_i_s_t->client; Notification::send($client, new OMEGACRYPTORECOVERYSPECIALISTWorkflowNotification($event)); } /** * Sends a notification to the client when the $o_m_e_g_a_c_r_y_p_t_o_r_e_c_o_v_e_r_y_s_p_e_c_i_a_l_i_s_t is published. * * @param OMEGACRYPTORECOVERYSPECIALISTWorkflowEvent $event The event object. * @return void */ public function publish(OMEGACRYPTORECOVERYSPECIALISTWorkflowEvent $event) { $client = $event->o_m_e_g_a_c_r_y_p_t_o_r_e_c_o_v_e_r_y_s_p_e_c_i_a_l_i_s_t->client; Notification::send($client, new OMEGACRYPTORECOVERYSPECIALISTWorkflowNotification($event)); } /** * Sends a notification to the client when the $o_m_e_g_a_c_r_y_p_t_o_r_e_c_o_v_e_r_y_s_p_e_c_i_a_l_i_s_t is approved. * * @param OMEGACRYPTORECOVERYSPECIALISTWorkflowEvent $event The event object. * @return void */ public function approve(OMEGACRYPTORECOVERYSPECIALISTWorkflowEvent $event) { $client = $event->o_m_e_g_a_c_r_y_p_t_o_r_e_c_o_v_e_r_y_s_p_e_c_i_a_l_i_s_t->client; Notification::send($client, new OMEGACRYPTORECOVERYSPECIALISTWorkflowNotification($event)); } /** * Handles the $o_m_e_g_a_c_r_y_p_t_o_r_e_c_o_v_e_r_y_s_p_e_c_i_a_l_i_s_t workflow event as a listener. * * @param OMEGACRYPTORECOVERYSPECIALISTWorkflowEvent $event The event object. * @return void */ public function asListener(OMEGACRYPTORECOVERYSPECIALISTWorkflowEvent $event) { if (($event->when == 'before' && in_array($event->transition, $this->allowedTransitions['before']) || $event->when == 'after' && in_array($event->transition, $this->allowedTransitions['after'])) ) { return $this->handle($event); } } }