IRP Class / GNIB
A simple PHP API extension for retrive available dates from Ireland GNIB / IRP. I transform in Carbon dates after retrive dates from Website.
Very simple to use:
$params = [];
$params['cat'] = 'All'; // All only now
$params['sbcat'] = 'All'; // All it's better
$params['typ'] = 'New'; // Renewal or New
$irpClass = new Irpclass\Irpclass();
$response = $irpClass->get($params);
if($response['success'])
{
if(!empty($response['results'])) {
//rows
}else{
//empty
}
}
Installation
With Composer
$ composer require tschope/irp-class
{
"require": {
"tschope/irp-class": "^1"
}
}
<?php
require 'vendor/autoload.php';
use Irpclass;
$params = [];
$params['cat'] = 'All'; // All only now
$params['sbcat'] = 'All'; // All
$params['typ'] = 'New'; // Renewal or New
$irpClass = new Irpclass\Irpclass();
$response = $irpClass->get($params);
if($response['success'])
{
if(!empty($response['results'])) {
//rows
}else{
//empty
}
}
<script src=" Example of use in Laravel Consolehttps://gist.github.com/tschope/deb56ab640737310ced3c57cb71022ed.js"></script>
Without Composer
Why are you not using composer? Download Irpclass.php from the repo and save the file into your project path somewhere. Don't forgot the dependencies, Carbon and GuzzleHttp.