phonghaw2/laravel-x-api-v2
Composer 安装命令:
composer require phonghaw2/laravel-x-api-v2
包简介
A small Laravel package for X API.
关键字:
README 文档
README
Installation
For Laravel ^6.0|^7.0|^8.0
This package can be installed through Composer.
composer require phonghaw2/laravel-x-api-v2
Optionally, you can publish the config file of this package with this command:
php artisan vendor:publish --provider="Phonghaw2\X\XServiceProvider"
Config
The following config file will be published in config/x.php
return [ 'api_base_uri' => 'https://api.twitter.com/2/', // The unique identifier for the Twitter account. // Account ID of the Twitter user 'app_id' => env('X_APP_ID', 1), // Your Twitter API consumer key (public key), obtained from the Twitter Developer Portal. // This key is used to identify your app when making API requests. (Consumer API key) 'api_key' => env('X_APP_KEY', 'CONSUMER_KEY'), // Your Twitter API consumer secret, also obtained from the Twitter Developer Portal. 'api_key_secret' => env('X_APP_KEY_SECRET', 'CONSUMER_SECRET'), // The bearer token, used for OAuth 2.0 authentication. // It is used in the HTTP headers when making requests to Twitter's API without the need for user authentication. 'bearer_token' => env('X_BEARER_TOKEN', 'BEARER_TOKEN'), // Access token, used for user authentication and authorization for Twitter API access on behalf of the user. // You must request this token after getting user consent. 'access_token' => env('X_ACCESS_TOKEN', 'ACCESS_TOKEN'), // Access token secret, paired with the access token to authenticate and authorize API calls. 'access_token_secret' => env('X_ACCESS_TOKEN_SECRET', 'ACCESS_TOKEN_SECRET'), ];
Usage
Here are a few examples of the provided methods:
TweetLookup
use Twitter; // Post lookup by Post IDs Twitter::tweetLookup() ->setQueryParams([ 'ids' => 111111111, 'max_results' => 5, // Must be a number between 1 and 100 (default: 100) 'pagination_token' => '5qym3iwo3naekslszn59lxy1d9nmc6q' ]) ->lookupPost(); // Creation of a Post Twitter::tweetLookup() ->setPostData([ 'media' => [ "media_ids": [ "11111" ], "tagged_user_ids": [ "2222" ] ], ]) ->create()
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
License
The MIT License (MIT). Please see License File for more information.
phonghaw2/laravel-x-api-v2 适用场景与选型建议
phonghaw2/laravel-x-api-v2 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 3, 最近一次更新时间为 2025 年 02 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「twitter」 「laravel」 「phonghaw2」 「x-api」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 phonghaw2/laravel-x-api-v2 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 phonghaw2/laravel-x-api-v2 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 phonghaw2/laravel-x-api-v2 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Handles basic OAuth/OAuth2 authentication along with classes for common services
Simple Twitter API wrapper
Simple Sharing generates social media share links within CP entry pages, allowing you to quickly & easily share entries.
A helper module for pdf-print, print and social share functionality based on bootstrap to custom modules.
Laravel package for the simplification and integration of many of your users most wanted login providers. Installation is a breeze. Never worry about OAuth again.
Magento 2 Social Login extension is designed for quick login to your Magento 2 store without procesing complex register steps
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-22