PHP code example of cmosguy / laravel-http-pushstream-broadcaster

1. Go to this page and download the library: Download cmosguy/laravel-http-pushstream-broadcaster library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cmosguy / laravel-http-pushstream-broadcaster example snippets



 namespace App\Events;

use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;

class SomeEvent implements ShouldBroadcast
{
    use SerializesModels;
    /**
     * @var Foo
     */
    public $foo;

    public function __construct(Foo $foo)
    {
        //
        $this->foo = $foo;
    }

    /**
     * Get the channels the event should be broadcast on.
     *
     * @return array
     */
    public function broadcastOn()
    {
        return ['foochannel-'.$this->foo->uuid];
    }
}