'Laravel Redis Sub

I want to create a condition in my laravel redis sub. with data like this

enter image description here

I want make condition from action, like this code:

Redis::subscribe('article', function ($event) {
     if($event->article['action'] == 'Store'){

        ArticleMessage::dispatch(json_decode($event));
     }
 });

It will work if I code like this one?, or I need change string from Subs, after than create the condition?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source