A Technology API designed to run standalone or part of a Laravel Application
Requirements:
- PHP 8.0
- Technology
You can install the package via composer:
composer require :vendor_slug/:package_slug
<?php
use VendorName\Api\Technology;
require 'vendor/autoload.php';
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
$dotenv->load();
$server = [
'api_url' => $_ENV['TECHNOLOGY_API_URL'],
'api_key' => $_ENV['TECHNOLOGY_API_KEY'],
'api_secret' => $_ENV['TECHNOLOGY_API_SECRET'],
];
$api = new Technology($server);
$result = $api->getInformation();
You can publish the config file with:
php artisan vendor:publish --provider="VendorName\Skeleton\SkeletonServiceProvider" --tag=":package_slug-config"
Framework Agnostic PHP:
$newRecord = ['test1', 'test2'];
$api = new Technology;
$api->post($test);
Laravel App:
$newRecord = ['test1', 'test2'];
Technology::post($newRecord);
Expected result:
A new record is added.
vendor/bin/phpunit
Use the command below to run tests that excludes touching the API:
vendor/bin/phpunit --exclude-group=live
The storage
folder has examples API responses, also used for caching during tests.
To regenerate coverage reports:
XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-html=tests/coverage-report
See also .travis.yml
For local editing, add this to composer.json
:
"repositories" : [
{
"type": "path",
"url": "../technology-api"
}
]
Then in require
section:
"fintech-systems/technology-api": "dev-main",
Please see CHANGELOG for more information on what has changed recently.
The MIT License (MIT). Please see License File for more information.