2017 © Pedro Peláez
 

library faye-laravel-broadcaster

Faye service laravel broadcaster

image

arnislielturks/faye-laravel-broadcaster

Faye service laravel broadcaster

  • Thursday, April 27, 2017
  • by ArnisLielturks
  • Repository
  • 0 Watchers
  • 0 Stars
  • 212 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

faye-laravel-broadcaster

This is a wrapper for https://github.com/ArnisLielturks/faye-client library. Intended for use in Laravel 5+ applications. This allows broadcasting messages to Faye service via Laravel events

Installation

  1. Install the package via composer: ```sh composer require arnislielturks/faye-laravel-broadcaster

2. Register the provider in config/app.php ```php // 'providers' => [ ArnisLielturks\FayeBroadcaster\FayeBroadcasterProvider::class, // ];
  1. Add configuration file (config/faye.php) with the following content. This should point to the Faye service
return [
    'server' => 'http://127.0.0.1:8000'
];
  1. Change the broadcast driver to Faye in (config/broadcasting.php
default' => env('BROADCAST_DRIVER', 'faye'),

OR set this value in .env file, (*1)

BROADCAST_DRIVER=faye
  1. Create event which will send out the broadcast via Faye service
class TestEvent implements ShouldBroadcast
{
    use Dispatchable, InteractsWithSockets, SerializesModels;

    //All public attributes will be sent with the message
    public $id;
    public $event = 'test_event';

    public function __construct()
    {
        $this->id = 123;
    }

    public function broadcastOn()
    {
        //List of channels where this event should be sent
        return ['/test_event'];
    }

}
  1. Send out the event via Controller
class TestController extends Controller
{
    public function test() {
        event(new TestEvent());
        return view('main');
    }
}

Outgoing message to the /test_event channel will look something like this:, (*2)

{ 
  id: 123,
  event: 'test_event',
  socket: null,
  event_object: 'App\\Events\\TestEvent'
}

That's it!, (*3)

The Versions

27/04 2017

dev-master

9999999-dev https://faye.jcoglan.com/

Faye service laravel broadcaster

  Sources   Download

MIT

The Requires

 

The Development Requires

by Arnis Lielturks

laravel faye faye-laravel-broadcaster laravel-broadcasting

27/04 2017

0.15

0.15.0.0 https://faye.jcoglan.com/

Faye service laravel broadcaster

  Sources   Download

MIT

The Requires

 

The Development Requires

by Arnis Lielturks

laravel faye faye-laravel-broadcaster laravel-broadcasting

27/04 2017

0.14.2

0.14.2.0 https://faye.jcoglan.com/

Faye service laravel broadcaster

  Sources   Download

MIT

The Requires

 

The Development Requires

by Arnis Lielturks

laravel faye faye-laravel-broadcaster laravel-broadcasting

24/04 2017

0.14

0.14.0.0 https://faye.jcoglan.com/

Faye service laravel broadcaster

  Sources   Download

MIT

The Requires

 

The Development Requires

by Arnis Lielturks

laravel faye faye-laravel-broadcaster laravel-broadcasting

24/04 2017

0.13.1

0.13.1.0 https://faye.jcoglan.com/

Faye service laravel broadcaster

  Sources   Download

MIT

The Requires

 

The Development Requires

by Arnis Lielturks

laravel faye faye-laravel-broadcaster laravel-broadcasting

24/04 2017

0.13

0.13.0.0 https://faye.jcoglan.com/

Faye service laravel broadcaster

  Sources   Download

MIT

The Requires

 

The Development Requires

by Arnis Lielturks

laravel faye faye-laravel-broadcaster laravel-broadcasting

24/04 2017

0.12

0.12.0.0 https://faye.jcoglan.com/

Faye service laravel broadcaster

  Sources   Download

MIT

The Requires

 

The Development Requires

by Arnis Lielturks

laravel faye faye-laravel-broadcaster laravel-broadcasting

24/04 2017

0.11

0.11.0.0 https://faye.jcoglan.com/

Faye service laravel broadcaster

  Sources   Download

MIT

The Requires

 

The Development Requires

by Arnis Lielturks

laravel faye faye-laravel-broadcaster laravel-broadcasting

24/04 2017

0.1

0.1.0.0 https://faye.jcoglan.com/

Faye service laravel broadcaster

  Sources   Download

MIT

The Requires

 

The Development Requires

by Arnis Lielturks

laravel faye faye-laravel-broadcaster laravel-broadcasting