https://github.com/myckhel/laravel-iaphub
IAPHUB APIs in laravel
https://github.com/myckhel/laravel-iaphub
iaphub iaphub-api laravel react-native react-native-iap react-native-iaphub
Last synced: 3 months ago
JSON representation
IAPHUB APIs in laravel
- Host: GitHub
- URL: https://github.com/myckhel/laravel-iaphub
- Owner: myckhel
- License: mit
- Created: 2020-10-14T18:41:37.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-05-12T08:34:21.000Z (about 1 year ago)
- Last Synced: 2025-02-15T04:02:30.198Z (3 months ago)
- Topics: iaphub, iaphub-api, laravel, react-native, react-native-iap, react-native-iaphub
- Language: PHP
- Homepage: https://iaphub.com/docs
- Size: 22.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Iaphub
[](https://packagist.org/packages/myckhel/laravel-iaphub)
[](LICENSE.md)
[]()
[](https://packagist.org/packages/myckhel/laravel-iaphub)## [Iaphub Doc Link](https://iaphub.com/docs)
## Install
Via Composer
```bash
composer require myckhel/laravel-iaphub
```## Setup
The package will automatically register a service provider.You need to publish the configuration file:
```bash
php artisan vendor:publish --provider="Myckhel\Iaphub\IaphubServiceProvider"
```This is the default content of the config file ```iaphub.php```:
```php
env("IAPHUB_API_KEY"),
"app_id" => env("IAPHUB_APP_ID"),
"env" => env("IAPHUB_APP_ENV"),
"hook_token" => env("IAPHUB_HOOK_TOKEN"),
// this middleware will be used for IAPHUB routes
"route_middleware" => 'iaphub_disabled', // comma separated values e.g 'auth:api,auth:web'
];
```
Update Your Projects `.env` with:
```
IAPHUB_API_KEY=XXXXXXXXXXXXXXXXX
IAPHUB_APP_ID=XXXXXXXXXXXXXXXXX
IAPHUB_HOOK_TOKEN=XXXXXXXXXXXXXXXXX
IAPHUB_APP_ENV=development
```
Run the database migration
```bash
php artisan migrate
```## Available Api's
```php
all());
}
}
```## Middleware
IAPHUB provided 2 middlewares
### `iaphub_hook_token`
For authenticating iaphub hook request
#### Example:
```php
middleware('iaphub_hook_token');```
### `iaphub_disabled`
For disabling route request
returns 403 response
#### Example:
```php
middleware('iaphub_disabled');
/* returns {
"message": "This Endpoint Is Disabled \n enable it by replacing the 'iaphub_disabled' middleware from your config",
}
*/```
## Todos
- coming soon## Testing
Run the tests with:``` bash
vendor/bin/phpunit
```## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.## Credits
- [myckhel](https://github.com/myckhel)
- [All Contributors](https://github.com/myckhel/laravel-iaphub/contributors)## Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.## License
The MIT License (MIT). Please see [License File](/LICENSE.md) for more information.