bernskioldmedia/laravel-better-proposals

This is an API wrapper class for the Better Proposals API.

dev-main 2023-09-30 10:23 UTC

This package is auto-updated.

Last update: 2024-11-09 19:29:11 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This package adds a fluent way of interacting with the Better Proposals proposal management system and its API.

Installation

You can install the package via composer:

composer require bernskioldmedia/laravel-better-proposals

You can publish the config file with:

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

This is the contents of the published config file:

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

use BernskioldMedia\BetterProposals\Facades\BetterProposals;

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

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

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

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

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.