PHPackages                             rbadillap/twitterstreaming-laravel - 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. [API Development](/categories/api)
4. /
5. rbadillap/twitterstreaming-laravel

ActiveLibrary[API Development](/categories/api)

rbadillap/twitterstreaming-laravel
==================================

TwitterStreaming Service Provider for Laravel

0.1.3(10y ago)1332MITPHP

Since Jan 3Pushed 10y agoCompare

[ Source](https://github.com/NinjaDevsIO/twitterstreaming-laravel)[ Packagist](https://packagist.org/packages/rbadillap/twitterstreaming-laravel)[ RSS](/packages/rbadillap-twitterstreaming-laravel/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (4)Used By (0)

TwitterStreaming Laravel 5 Service Provider
===========================================

[](#twitterstreaming-laravel-5-service-provider)

We are now supporting **TwitterStreamingPHP** with Laravel 5 through a [Service Provider](https://laravel.com/docs/master/providers) :)

Installation
------------

[](#installation)

This **TwitterStreamingPHP** Service Provider can be installed via [Composer](http://getcomposer.org/). Running the following command:

```
composer require rbadillap/twitterstreaming-laravel

```

Now you should register the provider in the Laravel application in your `config/app.php` configuration file:

```
'providers' => [
	// other service providers..

    TwitterStreaming\Laravel\TwitterStreamingServiceProvider::class
],
```

Also, add the `TwitterStreaming` facade in the `aliasses` array (located in the same file).

```
'TwitterStreaming' => TwitterStreaming\Laravel\Facades\TwitterStreaming::class
```

Also you may want to create a `twitterstreaming.php` configuration file, to do that and put on it the credentials of your Twitter App you should run the following command:

```
php artisan vendor:publish

```

Now, you can see a new file created in the `app` folder where you can add your credentials.

And ready to use!

Usage
-----

[](#usage)

[To understand how to use TwitterStreamingPHP please visit its documentation](https://github.com/TwitterStreamingPHP/twitterstreaming)

Extras
------

[](#extras)

Within this Service Package you will find some extra methods to simplify the way to work with **TwitterStreamingPHP** in Laravel. Let's take a look all of them:

### Simplified way to define the endpoints

[](#simplified-way-to-define-the-endpoints)

Instead of define the endpoints using the `endpoint` method in **TwitterStreamingPHP** you can call some methods which injects the endpoint (and its types) directly. For example:

```
// Instead of
(new Tracker)
    ->endpoint(Endpoints\PublicEndpoint::class, 'sample')

// You can call in Laravel
TwitterStreaming::publicSample()

// and continue with the rest of the code
```

All the methods to simplify the endpoints definitions listed here:

```
publicFilter()
// alias of endpoint(Endpoints\PublicEndpoint::class, 'filter')
```

```
publicSample()
// alias of endpoint(Endpoints\PublicEndpoint::class, 'sample')
```

```
user()
// alias of endpoint(Endpoints\UserEndpoint::class)
```

### Integration with Filters module

[](#integration-with-filters-module)

Are you using [Filters module?](https://github.com/TwitterStreamingPHP/twitterstreaming-filters)

If no, well, you should :)

If yes, we have been integrated into the Laravel Service Provider.

The only thing that you need to use is require the package using composer:

```
composer require rbadillap/twitterstreaming-filters

```

And use it without the need to register the new extension.

```
// this is not necessary
->addExtension(Extensions\Filters::class)

// TwitterStreamingPHP detects automatically if the module are included with composer
// and you can use filters method automatically

    ->filters(function ($filters) {
        return $filters
            // Use methods to filter tweets
            ->withoutRTs()
            ->withoutReplies()
            ->onlyFromAndroid();
    })
```

How can I use it in Laravel
---------------------------

[](#how-can-i-use-it-in-laravel)

There is some ways, but if you wanna combine Laravel and TwitterStreamingPHP you can create your own command

```
php artisan make:console TwitterTrack

```

And put your logic to track tweets.

```
        TwitterStreaming::publicFilter()
            ->parameters([
                'track' => '#realmadrid'
            ])
            ->filters(function ($filters) {
                return $filters
                    ->withoutRTs()
                    ->withoutReplies()
                    ->onlyFromAndroid();
            })
            ->track(function ($tweet) {
                print $tweet->text . ' (' . $tweet->source . ')' . PHP_EOL . PHP_EOL;
            });
```

Even better, you could dispatch a queue listener to store in database.

```
        TwitterStreaming::publicFilter()
            ->parameters([
                'track' => '#realmadrid'
            ])
            ->filters(function ($filters) {
                return $filters
                    ->withoutRTs()
                    ->withoutReplies()
                    ->onlyFromAndroid();
            })
            ->track(function ($tweet) {
                // php artisan make:job YourLaravelJob
                $this->dispatch(new YourLaravelJob($tweet));
            });
```

Contributing
------------

[](#contributing)

Use the same workflow as many of the packages that we have here in Github.

1. Fork the project.
2. Create your feature branch with a related-issue name.
3. Try to be clear with the code committed and follow the [PSR-2 Coding Style Guide](http://www.php-fig.org/psr/psr-2/).
4. Run the tests (and create your new ones if necessary).
5. Commit and push the branch.
6. Create the Pull Request.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

3

Last Release

3829d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3170758?v=4)[Ronny Badilla](/maintainers/rbadillap)[@rbadillap](https://github.com/rbadillap)

---

Top Contributors

[![rbadillap](https://avatars.githubusercontent.com/u/3170758?v=4)](https://github.com/rbadillap "rbadillap (13 commits)")

---

Tags

apilaravelstreamingservice providertwitterrealtime

### Embed Badge

![Health badge](/badges/rbadillap-twitterstreaming-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/rbadillap-twitterstreaming-laravel/health.svg)](https://phpackages.com/packages/rbadillap-twitterstreaming-laravel)
```

###  Alternatives

[smodav/mpesa

M-Pesa API implementation

16167.1k1](/packages/smodav-mpesa)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
