think.studio/laravel-naviga-ad

Unofficial web integration with naviga ad api

2.1.0 2023-07-09 07:22 UTC

This package is auto-updated.

Last update: 2024-12-09 11:42:34 UTC


README

Packagist License Packagist Version Total Downloads Build Status Code Coverage Scrutinizer Code Quality

Unofficial web integration with naviga ad api.
Web reference there

Installation

You can install the package via composer:

composer require think.studio/laravel-naviga-ad

php artisan vendor:publish --provider="NavigaAdClient\ServiceProvider" --tag="config"
NAVIGA_AD_API_USERNAME="api_user"
NAVIGA_AD_API_PASSWORD="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
NAVIGA_AD_API_BASE_URL="https://fin.navigahub.com/XxxxxXXXxxxxxx/XXX/api"

Usage

Direct call via facade:

$response = NavigaAd::pendingRequest()->get("campaigns/{$id}");
if ($response->status() == 400) {
   throw new Exception('Campaign deleted');
}
$result = $response->json();

Paginated query

/** @var PaginatedResponse $response */
$response = NavigaAd::paginatedRequest('book/ordertypes', perPage: 16, currentPage: 3)->retrieve();
// or
$response = NavigaAd::paginatedRequest('book/orders', 5)->setCurrentPage(2)->retrieve(queryData: [
    'LastModDate' => '2023-07-09T07:14:14.433Z'
]);

$response->entities();
$response->currentPage();
$response->totalPages();
$response->countEntities();
$response->totalEntities();

Credits

  • Think Studio