Download the PHP package fanout/laravel-fanout without Composer
On this page you can find all versions of the php package fanout/laravel-fanout. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fanout/laravel-fanout
More information about fanout/laravel-fanout
Files in fanout/laravel-fanout
Package laravel-fanout
Short Description Fanout.io library for Laravel.
License MIT
Homepage https://github.com/fanout/laravel-fanout
Informations about the package laravel-fanout
laravel-fanout
Author: Konstantin Bokarius [email protected]
Fanout.io library for Laravel.
Credit
This project is based on the following pull request by Christopher Thomas: https://github.com/cwt137/laravel-framework/commit/b64b57ec0dfac975db9fadecac9f7a3757b7af30
Requirements
- openssl
- curl
- pthreads (required for asynchronous publishing)
- php >=7.0.0
- laravel >= 5.5
- fanout/fanout >=2.0.0 (retrieved automatically via Composer)
Installation
Using Composer:
Manual: ensure that php-fanout has been included and require the following files in laravel-fanout:
Asynchronous Publishing
In order to make asynchronous publish calls pthreads must be installed. If pthreads is not installed then only synchronous publish calls can be made. To install pthreads recompile PHP with the following flag: '--enable-maintainer-zts'
Also note that since a callback passed to the publish_async methods is going to be executed in a separate thread, that callback and the class it belongs to are subject to the rules and limitations imposed by the pthreads extension.
See more information about pthreads here: http://php.net/manual/en/book.pthreads.php
Usage
In your config/broadcasting.php file set the default driver to 'fanout' and add the connection configuration like so:
In your config/app.php file add the following provider to your service providers array:
Add a custom broadcast event to your application like so:
Now to publish to Fanout.io in your application simply fire the event: