rangkotodotcom / pushnotif
An http client library to connect to the PUSHNOTIF API
Requires
- php: ^7.3|^7.4|^8.0|^8.1|^8.2|^8.3|^8.4
- ext-json: *
- guzzlehttp/guzzle: ^7.0.1|^7.2
- illuminate/http: ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0
- illuminate/support: ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0
Requires (Dev)
- orchestra/testbench: ^6.25|^7.0|^8.0|^9.0|^10.0
- phpunit/phpunit: ^11.0
This package is auto-updated.
Last update: 2025-05-13 10:58:23 UTC
README
This package is used to interact with the PUSHNOTIF API belonging to School.
Installation
You can install the package via composer:
composer require rangkotodotcom/pushnotif
Setup
You must register the service provider :
// config/app.php 'Providers' => [ // ... Rangkotodotcom\Pushnotif\PushnotifServiceProvider::class, ]
If you want to make use of the facade you must install it as well :
// config/app.php 'aliases' => [ // ... 'pushnotif' => Rangkotodotcom\Pushnotif\Pushnotif::class, ];
Next, You must publish the config file to define your Pushnotif CREDENTIAL :
php artisan vendor:publish --provider="Rangkotodotcom\Pushnotif\PushnotifServiceProvider"
This is the contents of the published file :
return [ /* |-------------------------------------------------------------------------- | Pushnotif Mode |-------------------------------------------------------------------------- | | By default, use development. Supported Mode: "development", "production" | */ 'pushnotif_mode' => env('PUSHNOTIF_MODE', 'development'), /* |-------------------------------------------------------------------------- | Pushnotif Client ID |-------------------------------------------------------------------------- | | Client ID from PUSHNOTIF API | */ 'pushnotif_client_id' => env('PUSHNOTIF_CLIENT_ID', ''), /* |-------------------------------------------------------------------------- | Pushnotif Client Secret |-------------------------------------------------------------------------- | | Client Secret from PUSHNOTIF API | */ 'pushnotif_client_secret' => env('PUSHNOTIF_CLIENT_SECRET', ''), /* |-------------------------------------------------------------------------- | Pushnotif Main Domain |-------------------------------------------------------------------------- | | Main Domain from PUSHNOTIF API | */ 'pushnotif_main_domain' => env('PUSHNOTIF_MAIN_DOMAIN', 'school.sch.id'), ];
Set your PUSHNOTIF CREDENTIAL in .env
file :
APP_NAME="Laravel"
# ...
PUSHNOTIF_MODE=developmentOrProduction
PUSHNOTIF_CLIENT_ID=putYourClientIdHere
PUSHNOTIF_CLIENT_SECRET=putYourClientSecretHere
PUSHNOTIF_MAIN_DOMAIN=domain.loc
Methods Ref
-
::registerToken()
-
::getMasterNotification()
-
::postMasterNotification()
-
::putMasterNotification()
-
::deleteMasterNotification()
-
::getNews()
-
::postNews()
-
::putNews()
-
::deleteNews()
-
::getInformation()
-
::postInformation()
-
::putInformation()
-
::deleteInformation()
-
::countNotification()
-
::getNotification()
-
::getNotificationById()
-
::postNotification()
-
::readNotification()
-
::deleteJobNotification()
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.