Skip to content
A package for interacting with the new IPBoard REST API.
PHP
Branch: master
Clone or download
A-Lawrence Merge pull request #3 from gtjamesa/ForumsTopicsPosts
Separated endpoints into traits, and some general tidy up/refactoring.
Addition of getForum functionality.
Latest commit f9a00c3 Oct 17, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config no message Jan 5, 2016
src Added get forum functionality Feb 15, 2018
.gitignore no message Jan 5, 2016
LICENSE no message Jan 5, 2016
composer.json no message Jan 5, 2016
readme.md Fixed broken pagination/searchCriteria in `getRequest()` Feb 15, 2018

readme.md

Laravel IPBoard API

Packagist License Latest Stable Version Latest Unstable Version Total Downloads

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

After updating composer, add this package's ServiceProvider to the providers array in config/app.php

< Laravel 5.4:

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

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.

You can’t perform that action at this time.