PHPackages                             nawaf/laravel-x - 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. nawaf/laravel-x

ActiveLibrary[API Development](/categories/api)

nawaf/laravel-x
===============

A Laravel package providing a simple and elegant wrapper around Abraham\\TwitterOAuth, allowing seamless integration with the X (formerly Twitter) API in Laravel applications.

1.0.0(3mo ago)03↓90%MITPHP

Since Apr 2Pushed 3mo agoCompare

[ Source](https://github.com/m9ebah/laravel-x)[ Packagist](https://packagist.org/packages/nawaf/laravel-x)[ RSS](/packages/nawaf-laravel-x/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

[![Screenshot](assets/laravel.svg)](assets/laravel.svg)[![Logo](assets/logo-white.png)](assets/logo-white.png)

Laravel X (formerly Twitter)
============================

[](#laravel-x-formerly-twitter)

A Laravel package providing a simple and elegant wrapper around [Abraham\\TwitterOAuth](https://github.com/abraham/twitteroauth), allowing seamless integration with the X (formerly Twitter) API in Laravel applications.

---

📦 Installation
--------------

[](#-installation)

Install the package via Composer:

```
composer require nawaf/laravel-x
```

The package will automatically register the service provider and facade.

⚙️ Configuration
----------------

[](#️-configuration)

Publish the configuration file using Artisan:

```
php artisan vendor:publish --provider="Nawaf\LaravelX\XServiceProvider"
```

This will create a config/x.php file. Then, add your X (Twitter) API credentials in your **.env** file:

```
CONSUMER_KEY=your_consumer_key
CONSUMER_SECRET=your_consumer_secret
ACCESS_TOKEN=your_access_token
ACCESS_TOKEN_SECRET=your_access_token_secret
```

🚀 Usage
-------

[](#-usage)

You can use the X facade to access any method provided by the underlying TwitterOAuth library:

```
// Example: posting a tweet
$response = X::post('statuses/update', ['status' => 'Hello X!']);

// Example: fetching your timeline
$tweets = X::get('statuses/home_timeline');
```

Or, inject the service directly:

```
use Nawaf\LaravelX\X;

public function __construct(X $x)
{
    $this->x = $x;
}

public function index()
{
    $tweets = $this->x->get('statuses/home_timeline');
    return $tweets;
}
```

Any method called on the X facade or service will be forwarded to the underlying [TwitterOAuth](https://github.com/abraham/twitteroauth) connection.

📝 Methods
---------

[](#-methods)

Since this package wraps `Abraham\TwitterOAuth`, you can use any of its methods, for example:

- `get($endpoint, $parameters = [])`
- `post($endpoint, $parameters = [])`
- `upload($endpoint, $parameters = [])`
-

`OAuth2/` methods if needed

Refer to the [TwitterOAuth documentation](https://twitteroauth.com/)for full details.

🤝 Contribution
--------------

[](#-contribution)

We welcome all contributions to improve the project. You can open an Issue or submit a Pull Request.

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance82

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

90d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/26290897?v=4)[M9eBaH](/maintainers/m9ebah)[@m9ebah](https://github.com/m9ebah)

---

Top Contributors

[![m9ebah](https://avatars.githubusercontent.com/u/26290897?v=4)](https://github.com/m9ebah "m9ebah (5 commits)")

### Embed Badge

![Health badge](/badges/nawaf-laravel-x/health.svg)

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

###  Alternatives

[rezozero/mixedfeed

A PHP library to get social networks feeds and merge them

11131.3k](/packages/rezozero-mixedfeed)

PHPackages © 2026

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