Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fintech-systems/packagist-boilerplate

Boilerplate for starting new a Packagist package generally used by Laravel and an API
https://github.com/fintech-systems/packagist-boilerplate

Last synced: about 1 month ago
JSON representation

Boilerplate for starting new a Packagist package generally used by Laravel and an API

Awesome Lists containing this project

README

        

# Technology API
![GitHub release (latest by date)](https://img.shields.io/github/v/release/fintech-systems/packagist-boilerplate) [![Build Status](https://app.travis-ci.com/fintech-systems/packagist-boilerplate.svg?branch=main)](https://app.travis-ci.com/fintech-systems/packagist-boilerplate) ![GitHub](https://img.shields.io/github/license/fintech-systems/packagist-boilerplate)

A Technology API designed to run standalone or part of a Laravel Application

Requirements:

- PHP 8.0
- Technology

## Installation

You can install the package via composer:

```bash
composer require :vendor_slug/:package_slug
```

# Usage

## Framework Agnostic PHP

```php
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();
```

## Laravel Installation

You can publish the config file with:
```bash
php artisan vendor:publish --provider="VendorName\Skeleton\SkeletonServiceProvider" --tag=":package_slug-config"
```

# Features

## Feature 1

Framework Agnostic PHP:

```php
$newRecord = ['test1', 'test2'];

$api = new Technology;
$api->post($test);
```

Laravel App:

```php
$newRecord = ['test1', 'test2'];

Technology::post($newRecord);
```

Expected result:

A new record is added.

## Testing

```bash
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.

### Coverage reports

To regenerate coverage reports:

`XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-html=tests/coverage-report`

See also `.travis.yml`

### Local Editing

For local editing, add this to `composer.json`:

```json
"repositories" : [
{
"type": "path",
"url": "../technology-api"
}
]
```

Then in `require` section:

```json
"fintech-systems/technology-api": "dev-main",
```

## Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

## Credits

- [:author_name](https://github.com/:author_username)
- [All Contributors](../../contributors)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.