How To Build A Slack Bot Using Laravel

Submitted by azazqadir - 1 year ago

This tutorial demonstrates how you can build a simple “Hello World” Slackbot by using Laravel. Slack is a cloud-based team collaboration tool co-founded by Stewart Butterfield, Eric Costello, Cal Henderson, and Serguei Mourachov. It offers a lot of IRC-like features including persistent chat rooms (channels) organized by topic, as well as private groups and direct messaging. Source:

$ vim app/Controller/SlackController.php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\View;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
class SlackController extends Controller
public function pushData()
\Slack::send('Hello World')

Ads cover the costs of maintaining Laravel-tricks

comments powered by Disqus

Ads cover the costs of maintaining Laravel-tricks