rangkotodotcom/pushnotif

An http client library to connect to the PUSHNOTIF API

1.0.0 2025-05-05 12:14 UTC

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.

Latest Version on Packagist Total Downloads

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.