Auth::user()->account_id, 'author_id' => Auth::id(), 'user_notification_channel_id' => $userNotificationChannelId, ]; $channel = UserNotificationChannel::find($userNotificationChannelId); if ($channel->type == UserNotificationChannel::TYPE_EMAIL) { (new SendTestEmail)->execute($data); } if ($channel->type == UserNotificationChannel::TYPE_TELEGRAM) { (new SendTestTelegramNotification)->execute($data); } return response()->json([ 'data' => true, ], 200); } }