Looking to hire Laravel developers? Try LaraJobs

laravel-ipboardapi maintained by bavirtual

Description
Laravel Package for Accessing IPBoards API
Author
Matt Bozwood-Davies
Last update
2022/11/03 11:22 (dev-main)
License
Links
Downloads
202

Comments
comments powered by Disqus

Laravel - IPBoard API

Begin by installing this package through Composer. Run the following from the terminal:
composer require bavirtual/laravel-ipboardapi

To expose the neccessary configuration, run
php artisan vendor:publish --tag=config --provider=BAVirtual\IPBoardApi\IpboardApiLaravelServiceProvider

Add the following properties to your .env file

  • IPBOARD_API_URL
  • IPBOARD_API_KEY

To use the package, add LaravelIPB to a constructor. This package can be used both statically or non-statically.

<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use BAVirtual\IPBoardApi\LaravelIPB;

class UpdateNews extends Command
{
    protected $laravelIpb;
    
    public function __construct(LaravelIPB $laravelIpb)
    {
        $this->laravelIpb = $laravelIpb;
        parent::__construct();
    }

    public function handle()
    {
        $request = [
            'forums' => 24,
            'sortBy' => 'date',
            'sortDir' => 'desc'
        ];
        $announcements = $this->laravelIpb->getTopics($request);
        ...
    }
}