PHPackages                             bfg/puller - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. bfg/puller

ActivePackage[Utility &amp; Helpers](/categories/utility)

bfg/puller
==========

A description for puller.

2.1.1(2y ago)07313MITPHPPHP &gt;=7.4

Since Dec 25Pushed 2y ago2 watchersCompare

[ Source](https://github.com/bfg-s/puller)[ Packagist](https://packagist.org/packages/bfg/puller)[ RSS](/packages/bfg-puller/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (7)Used By (3)

Puller (Long Pull)
==================

[](#puller-long-pull)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/71b2ab4891b48316e7661b0b60f65c8286f3b5a476c8450601119641ffe59c35/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6266672f70756c6c65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bfg/puller)

Install
-------

[](#install)

`composer require bfg/puller`

In a nutshell
-------------

[](#in-a-nutshell)

This package is intended for cases when you need a minimum real time, but to raise the WebSocket too expensive or meaningless. The essence of the package is the simplest Long Pull, which is easy to install and configure. It added control over the user's tabs, which allows us to control the status of all the user tabs and send commands to all the user tabs at all, to all browsers. So, we have an excellent opportunity to follow the online meter and a real-time list of users.

Redis
-----

[](#redis)

Be careful, the package uses the default caching system by default, with the driver that is listed there, but if you switch the caching driver to `redis`, then you will feel a significant increase in speed and get a better and accurate task distribution system and online.

```
...
CACHE_DRIVER=redis
...
```

> To do this, you should have the extension `Redis` for `php`.

Usage
-----

[](#usage)

In order to start using, you need to make a couple of simple things:

1. Make sure that in your `public/vendor` folder published `puller/puller.js`. He had to appear immediately after installing the package, as it broads publications in the `laravel-assets` group. If this did not happen and you did not appear there, publish it manually:

```
php artisan vendor:publish --tag=puller-assets
```

2. Connect the script in your document:

```

```

3. Prepare your own document event listener:

```
document.addEventListener('my_test', function ({detail}) {
    console.log(detail);
});
```

4. Submit the Puller command:

```
\Puller::user(Auth::user())
    ->channel('my_test')
    ->stream('Hello world!');
```

Further, in the browser, in the developer console, you will see the reaction.

Advanced puller
---------------

[](#advanced-puller)

> If you want the main processing and data from receiving data on the side of the task recipient, you must use that advanced `Pullers`, since the `handle` method is always performed on the recipient side.

Generate worker:

```
php artisan make:task MyTestPull

```

After that, you will have a class worker: `app/Pulls/MyTestPull.php`

```
