Skip to content

Instantly share code, notes, and snippets.

@MrAtiebatie
Last active May 2, 2018 09:48
Show Gist options
  • Save MrAtiebatie/8e5f9812d7c40f36622bbb4ac1838f32 to your computer and use it in GitHub Desktop.
Save MrAtiebatie/8e5f9812d7c40f36622bbb4ac1838f32 to your computer and use it in GitHub Desktop.
<?php
use App\Events\SendMessage;
use Illuminate\Http\Request;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/', function () {
return view('welcome');
});
Route::post('/broadcast', function (Request $request) {
// Fire the SendMessage event
event(new SendMessage($request->message));
return redirect()->back();
})->name('broadcast');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment