bddarwin/laravel-ipboard
Composer 安装命令:
composer require bddarwin/laravel-ipboard
包简介
IPBoard API integration with Laravel
README 文档
README
This package includes accessor methods for all common IPBoard API calls:
- Members
- Forum Posts
- Forum Topics
Installation
Require this package with composer:
composer require alawrence/laravel-ipboard
Laravel 5.5:
In order to set the required variables for your instance of IPBoard, you must first publish the configuration files:
php artisan vendor:publish
Then, edit your API key and IP.Board URL into config/ipboard.php
< Laravel 5.4:
After updating composer, add this package's ServiceProvider to the providers array in config/app.php
ServiceProvider:
Alawrence\Ipboard\ServiceProvider::class,
Facade:
'Ipboard' => Alawrence\Ipboard\Facade::class,
In order to set the required variables for your instance of IPBoard, you must first publish the configuration files:
php artisan vendor:publish
Then, edit your API key and IP.Board URL into config/ipboard.php
Usage
To utilise any of the API endpoints, refer to the list of available calls.
core/members
$ipboard = new IPBoard(); $recentlyJoined = $ipboard->getMembersByPage("date", "desc"); $allMembers = $ipboard->getMembersAll(); $singleMember = $ipboard->getMemberById(2011); $newMember = $ipboard->createMember("Test Api User", "test-user@gmail.com", "this_is_My_password!"); // Will be added to default group. $anotherMember = $ipboard->createMember("Test Api User 2", "test-user-2@gmail.com", "this_is_not_secret", 24); // Will be added to group 24. $updateMember = $ipboard->updateMember(2011, ["name" => "This Is THe New Name", "password" => "The new password" => "email" => "im_sleeping@gmail.com"]); $ipboard->deleteMemberById(2011);
forums/posts
$ipboard = new IPBoard(); $recentPosts = $ipboard->getForumPostsByPage(["sortBy" => "date", "sortDir" => "desc"]); // Refer to IPBoard API reference for more search criteria. $allPosts = $ipboard->getForumPostsAll(); // I would think carefully before doing this. $singlePost = $ipboard->getForumPostById(12); // Get post ID 12. $newPost = $ipboard->createForumPost(5, 2011, "<p>This is <strong>my</strong> HTML post.</p>"); // Topic 5, author 2011. Refer to IPBoard API for more data you can provide. $newGuestPost = $ipboard->createForumPost(5, 0, "<p>This is a <em>guest</em> post.</p>", ["author_name" => "My User's Guest Name"]); // Topic 5, author 0 with specified name. Refer to IPBoard API for more data you can provide. $updatedPost = $ipboard->updateForumPost(567, ["post" => "<p>This content has been removed.</p>"]); // Update post 567. Refer to IPBoard API for more data you can provide. $ipboard->deleteForumPostById(567);
forums/topics
$ipboard = new IPBoard(); $recentTopics = $ipboard->getForumTopicsByPage(["sortBy" => "date", "sortDir" => "desc"]); // Refer to IPBoard API reference for more search criteria. $allTopics = $ipboard->getForumTopicsAll(); // I would think carefully before doing this. $singleTopic = $ipboard->getForumTopicById(53); // Get topic ID 53; $topicPosts = $ipboard->getForumTopicPosts(53, ["sortDir" => "desc"], 2); // Get all 2nd page of posts for a topic ID 53, sorted descending $newTopic = $ipboard->createForumTopic(2, 2011, "My New Post Title", <p>This is <strong>my</strong> HTML post.</p>"); // Forum 2, author 2011. Refer to IPBoard API for more data you can provide. $newGuestTopic = $ipboard->createForumTopic(2, 0, "My guest title", <p>This is a <em>guest</em> post.</p>", ["author_name" => "My User's Guest Name"]); // Forum 2, author 0 with specified name. Refer to IPBoard API for more data you can provide. $updateTopic = $ipboard->updateForumTopic(56, ["title" => "Removed title", "post" => "<p>This content has been removed.</p>"]); // Update topic 56. Refer to IPBoard API for more data you can provide. $ipboard->deleteForumTopicById(567);
Contribution
I appreciate there are elements of the API that haven't been implemented, as my license doesn't contain them. If you wish to submit a PR I'll gladly accept.
bddarwin/laravel-ipboard 适用场景与选型建议
bddarwin/laravel-ipboard 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 26 次下载、GitHub Stars 达 2, 最近一次更新时间为 2019 年 05 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「rest」 「api」 「forum」 「restful」 「laravel」 「board」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 bddarwin/laravel-ipboard 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bddarwin/laravel-ipboard 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 bddarwin/laravel-ipboard 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel 5 package providing a solid foundation for building discussion forums
A frontend for riari/laravel-forum providing views written with Bootstrap 3
This Bundle provides threaded comment functionality for Symfony applications
A PSR-7 compatible library for making CRUD API endpoints
Api bundle
A Flickr wrapper to allow you to call the Flickr api with Guzzle as the backend.Goal is to have 100% Flickr api coverage rather than just upload/display photos (currently at 23%).
统计信息
- 总下载量: 26
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-05-16