Created
June 28, 2016 07:49
-
-
Save Maras0830/7cea4c247e3acccb9b1c88b3c49cfc13 to your computer and use it in GitHub Desktop.
app\Controllers\HomeController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use App\Events\SendMessage; | |
use Illuminate\Http\Request; | |
use App\Http\Requests; | |
class HomeController extends Controller | |
{ | |
public function firingEvents(Request $request) | |
{ | |
$username = $request->get('username'); | |
$message = $request->get('message'); | |
$user = [ | |
'id' => 10001, | |
'username' => $username, | |
]; | |
event(new SendMessage($user, $message)); | |
return 'message sent'; | |
} | |
public function getPusherMessage() | |
{ | |
$member_id = 10001;// maybe you can make web notification with Auth. | |
return view('push')->with(compact('member_id')); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment