Saritasa / php-laravel-notifications-api by saritasa

Implementation for notifications API
3,072
0
10
Package Data
Maintainer Username: saritasa
Maintainer Contact: sergey@saritasa.com (Sergey Populov)
Package Create Date: 2017-04-10
Package Last Update: 2022-08-26
Language: PHP
License: MIT
Last Refreshed: 2024-04-11 03:12:30
Package Statistics
Total Downloads: 3,072
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 10
Total Forks: 1
Total Open Issues: 0

PHP Laravel Notifications API

Build Status Release PHPv Downloads

Implementation of Notifications API.

Laravel 5.x

Install the saritasa/laravel-notifications-api package:

$ composer require saritasa/laravel-notifications-api

If you use Laravel 5.4 or less, or 5.5+ with package discovery disabled, add the NotificationsApiServiceProvider in config/app.php:

'providers' => array(
    // ...
    Saritasa\PushNotifications\NotificationsApiServiceProvider::class,
)

Models (DB mapping)

NotificationType

Description of possible notification type, and if it should be on or off by default.

Mandatory fields

  • id (int)
  • name (string)
  • default_on (boolean)

NotificationSetting

User's personal setting value - if certain notification type is on or off.

Mandatory fields:

  • id (int)
  • user_id (int)
  • notification_type_id (int)
  • is_on (boolean)

Contributing

  1. Create fork, checkout it
  2. Develop locally as usual. Code must follow PSR-1, PSR-2 - run PHP_CodeSniffer to ensure, that code follows style guides
  3. Cover added functionality with unit tests and run PHPUnit to make sure, that all tests pass
  4. Update README.md to describe new or changed functionality
  5. Add changes description to CHANGES.md file. Use Semantic Versioning convention to determine next version number.
  6. When ready, create pull request

Make shortcuts

If you have GNU Make installed, you can use following shortcuts:

  • make cs (instead of php vendor/bin/phpcs) - run static code analysis with PHP_CodeSniffer to check code style
  • make csfix (instead of php vendor/bin/phpcbf) - fix code style violations with PHP_CodeSniffer automatically, where possible (ex. PSR-2 code formatting violations)
  • make test (instead of php vendor/bin/phpunit) - run tests with PHPUnit
  • make install - instead of composer install
  • make all or just make without parameters - invokes described above install, cs, test tasks sequentially - project will be assembled, checked with linter and tested with one single command

Resources