Laravel Polar API is a Laravel package that provides an API wrapper for polar.sh API. This package simplifies the process of interacting with the Polar API by providing a set of convenient methods and classes.
To install the package, you can use Composer:
composer require hdinnovations/laravel-polar-apiphp artisan vendor:publish --provider="HDInnovations\LaravelPolarApi\Providers\PolarApiServiceProvider"This command will publish a polar-api.php file in your config directory. You can use this file to configure the package.
The configuration file contains the following options:
base_url: The base URL of the POLAR API.token: The token (PAT) used to authenticate requests to the POLAR API.
You can also set the POLAR_API_BASE_URL and POLAR_API_TOKEN environment variables in your .env file which is recommended.
Please refer to our documentation for detailed information on how to use this package and the endpoints + parameters it supports.
The package throws the following exceptions:
HDInnovations\LaravelPolarApi\Exceptions\PolarApiNotFoundException: Thrown when the requested resource is not found.HDInnovations\LaravelPolarApi\Exceptions\PolarApiUnprocessableEntityException: Thrown when the request is invalid.HDInnovations\LaravelPolarApi\Exceptions\PolarApiValidationException: Thrown when the request validation fails.HDInnovations\LaravelPolarApi\Exceptions\PolarApiUnauthorizedException: Thrown when the request is unauthorized.
To run the tests, use the following command:
composer testTo generate the test coverage, use the following command:
composer test-coverageTo run static analysis, use the following command:
composer analyzeTo check the type coverage, use the following command:
composer test-type-coverageThe package is open-source software licensed under the MIT license.
- Support all GET requests
- Support all POST requests
- Support all PUT requests
- Support all DELETE requests
- Add more exception handling
- Add more examples
- 100% test coverage
- 100% type coverage