承接 nawaf/laravel-x 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nawaf/laravel-x

最新稳定版本:1.0.0

Composer 安装命令:

composer require 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.

README 文档

README

Screenshot Logo

Laravel X (formerly Twitter)

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

📦 Installation

Install the package via Composer:

composer require nawaf/laravel-x

The package will automatically register the service provider and facade.

⚙️ 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

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 connection.

📝 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 for full details.

🤝 Contribution

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

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固