. */ namespace Poniverse\Ponyfm\Jobs; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Queue\InteractsWithQueue; use Notification; use Poniverse\Ponyfm\Models\Comment; use SerializesModels; class ProcessComment extends Job implements ShouldQueue { use InteractsWithQueue, SerializesModels; protected $comment; /** * Create a new job instance. * * @param Comment $comment */ public function __construct(Comment $comment) { $this->comment = $comment; } /** * Execute the job. * * @return void */ public function handle() { $this->beforeHandle(); $replies = Comment::findMany($this->comment->getMentionedCommentIds()); foreach ($replies as $reply) { Notification::newCommentReply($this->comment, $reply); } } }