Aronaman
2 months ago
350
5
Laravel

event and listener

Posted 2 months ago by Aronaman

my event is not triggering ??

public function store(Request $request, $blog)
{
    if($request->ajax())
     {
       $input['blog_post_id'] = $blog;
        Comment::create($input);
        event(new BlogNewCommentNotificationEvent($input));
        return response()->json(['success'=>'Successfull, Wait Untile Approve!!']);
          
     }
}

successful store the record, but not trigger the event then I tryPHP artisan queue:worknoting happen! it is b/c ajax function??

Please sign in or create an account to participate in this conversation.