A api client implementation in laravel of primetrust api.
bsiorg/primetrust-client-laravel is a Laravel package for a api client implementation in laravel of primetrust api..
It currently has 0 GitHub stars and 0 downloads on Packagist.
Install it with composer require bsiorg/primetrust-client-laravel.
Discover more Laravel packages by bsiorg
or browse all Laravel packages to compare alternatives.
Last updated
A client implementation of primetrust api in Laravel with very beautiful, expressive syntax. You don't need to worry about the behind the scene, just enjoy working with primetrust.
composer require bsiorg/primetrust-client-laravel
Utilities autoloading in Laravel 5.5+. For older versions add the following lines to your config/app.php
'providers' => [
...
\BsiOrg\PrimeTrust\PrimeTrustServiceProvider::class,
...
],
'aliases' => [
...
'PrimeTrust' => \BsiOrg\PrimeTrust\PrimeTrust::class,
...
]
You need to set environment variables to run the primetrust sdk.
PRIMETRUST_URL=
PRIMETRUST_USER=
PRIMETRUST_PASS=
You can use the whole library with facade like so:
use BsiOrg\PrimeTrust\Facades\PrimeTrust;
$pt = PrimeTrust::account()->all();
This sdk at that moment support all the resources of primetrust, and you can use any resource after the PrimeTrust::
PrimeTrust::resource('accounts')->all();
PrimeTrust::accounts()->all();
PrimeTrust::contracts()->all();
PrimeTrust::amlChecks()->all();
PrimeTrust::accountCashTotals ()->all();
Heavily inspired by Larvael so all the filters with beautiful, expressive syntax are available in this sdk.
PrimeTrust::accounts()
->with('contacts')
->with('account-cash-totals')
->where('name', 'sw', 'Rizi')
->latest()
->limit(5)
->get();
It basically includes any allowed resources available with main resource, in result to get both result in one call.
You can include multiple resources with just method chaining.
You can filter down your results with the help of all the available operators such as:
eq: Equals (exact match). Used when no operator is specified.gt: Greater than.gte: Greater than or equal to.in: Any item is an exact match. Takes special syntax, so if you wanted something where a status was one of a few,
you would pass ?filter[status in]=pending,processing.like: Case insensitive search. Does NOT support wildcards as of right now.lt: Less than.lte: Less than or equal to.neq: NOT equal.nin: NOT in.nlike: NOT like.sw: Starts with. Look for strings that being with filter value. Case insensitive.// example to get all the users who are between 18 and 30
PrimeTrust::contacts()
->where('date-of-birth', 'gt', '2002-01-01')
->where('date-of-birth', 'lt', '1990-01-01')
->limit(10)
->orderBy('created-at') // to get younger first
->get();
You can sort the api request by any column which supported in primetrust api with the help of orderBy, orderByAsc
, orderByDesc, latest() and oldest().
You can narrow down your result to your desire amount or can skip the results and directly go to your desire page.
PrimeTrust::contributions()
->where('account.id', 'eq', 'XXXX')
->limit(5)
->latest()
->get();
Mubashir Rasool Razvi (@rizimore)
[email protected]