dev-master
9999999-devLaravel 5 and ratchet integration
MIT
The Requires
The Development Requires
Wallogit.com
2017 © Pedro Peláez
Laravel 5 and ratchet integration
Laravel 5 and ratchet integration, (*1)
Require composer, (*2)
"admsa/larachet": "dev-master"
Add provider to your config/app.php, (*3)
'providers' => [
// Existing providers
'Admsa\Larachet\LarachetServiceProvider',
]
Add facade alias to your config/app.php, (*4)
'aliases' => [
// Existing aliases
'Larachet' => 'Admsa\Larachet\LarachetFacade'
]
$data = [];
Larachet::push('kittens-category', $data);
Javascript code usage, (*5)
var r = new Larachet('ws://localhost:8080');
r.watch('kittens-category', function(topic, data) {
console.log('New article published to category "' + topic + '" : ' + JSON.stringify(data));
});
r.watch('puppy-category', function(topic, data) {
console.log('New article published to category "' + topic + '" : ' + JSON.stringify(data));
});
This is still under development., (*6)
Javascript code is already loaded. Kindly check the html source code., (*7)
http://blog.alexandervn.nl/2012/05/03/install-zeromq-php-ubuntu, (*8)
Laravel 5 and ratchet integration
MIT