hdinnovations/laravel-polar-api
最新稳定版本:v1.0.0
Composer 安装命令:
composer require hdinnovations/laravel-polar-api
包简介
An API wrapper for the POLAR API.
README 文档
README
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.
Installation
To install the package, you can use Composer:
composer require hdinnovations/laravel-polar-api
Configuration
After installing the package, you need to publish the configuration file:
php 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.
Usage Documentation
Please refer to our documentation for detailed information on how to use this package and the endpoints + parameters it supports.
Exceptions
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.
Testing
To run the tests, use the following command:
composer test
Test Coverage
To generate the test coverage, use the following command:
composer test-coverage
Static Analysis
To run static analysis, use the following command:
composer analyze
Type Coverage
To check the type coverage, use the following command:
composer test-type-coverage
License
The package is open-source software licensed under the MIT license.
Roadmap
- 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
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 14
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-09-19