"#{$room}", "text" => $message, "icon_emoji" => $icon )); // You can get your webhook endpoint from your Slack settings $ch = curl_init("WEBHOOK ENDPOINT GOES HERE"); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($ch); curl_close($ch); // Laravel-specific log writing method // Log::info("Sent to Slack: " . $message, array('context' => 'Notifications')); return $result; }