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

https://github.com/bernskioldmedia/laravel-better-proposals

This is an API wrapper for the Better Proposals API.
https://github.com/bernskioldmedia/laravel-better-proposals

Last synced: 4 months ago
JSON representation

This is an API wrapper for the Better Proposals API.

Awesome Lists containing this project

README

        

# Laravel Better Proposals API

[![Latest Version on Packagist](https://img.shields.io/packagist/v/bernskioldmedia/laravel-better-proposals.svg?style=flat-square)](https://packagist.org/packages/bernskioldmedia/laravel-better-proposals)
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/bernskioldmedia/laravel-better-proposals/run-tests?label=tests)](https://github.com/bernskioldmedia/laravel-better-proposals/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/bernskioldmedia/laravel-better-proposals/Check%20&%20fix%20styling?label=code%20style)](https://github.com/bernskioldmedia/laravel-better-proposals/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/bernskioldmedia/laravel-better-proposals.svg?style=flat-square)](https://packagist.org/packages/bernskioldmedia/laravel-better-proposals)

This package adds a fluent way of interacting with the [Better Proposals](https://betterproposals.io) proposal
management system and its API.

## Installation

You can install the package via composer:

```bash
composer require bernskioldmedia/laravel-better-proposals
```

You can publish the config file with:

```bash
php artisan vendor:publish --tag="better-proposals-config"
```

This is the contents of the published config file:

```php
return [

/**
* The API key used for authenticating with the Better Proposals API.
*/
'api_key' => env('BETTER_PROPOSALS_API_KEY', ''),

/**
* The Base URL for the BetterProposals API including the version.
* This package currently only supports V2 of the API.
*/
'base_url' => env('BETTER_PROPOSALS_API_URL', 'https://api.betterproposals.io'),

];
```

## Usage

The package provides a convenient facade to interact with all resources. The package will let you consume the API
through fluent methods, but will not touch or map the response coming from the API. Please see
the [Better Proposals API docs](https://betterproposals.io/resources/api/)
for more information on responses.

The package currently supports all Better Proposals API resources. Your IDE should discover them on the facade when
typing.

When getting lists using the `all` method there are also fluent filtering methods to help you filter. Additionally, some
resources have "actions" as well. The names of these functions match mostly to the parameters in the Better Proposals
API docs.

```php
use BernskioldMedia\BetterProposals\Facades\BetterProposals;

BetterProposals::companies()->all();

BetterProposals::proposals()->signed();

BetterProposals::proposals()->all();

BetterProposals::proposals()->create(['...']);
```

## Testing

```bash
composer test
```

## Changelog

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

## Credits

- [Bernskiold Media](https://github.com/bernskioldmedia)
- [All Contributors](../../contributors)

## License

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