2017 © Pedro Peláez
 

library notifier

image

carkii/notifier

  • Friday, September 22, 2017
  • by carkii
  • Repository
  • 1 Watchers
  • 0 Stars
  • 19 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

notifier

Notifier is a laravel library that helps you to popup notifications to your registered users., (*1)

requirements

1- Jquery, (*2)

How to install ?

  • Composer: type composer require carkii/notifier

configaration (provider & alias)

in config\app.php, add notifier service provider :, (*3)

'providers' => [
    /*  
    //
    other providers
    //
    */
    Carkii\Notifier\NotifierServiceProvider::class,
  ]

and add aliase to same file:, (*4)

'aliases' => [
    /*  
    //
    other aliases
    //
    */
    'Notifier' => Carkii\Notifier\facades\Notifier::class,
  ]

publish

publish the required files by typing php artisan vendor:publish in terminal., (*5)

This will add the following to your project:, (*6)

1- /config/notifier.php, (*7)

2- /resources/views/notifications/_cardExample.blade.php, (*8)

3- /resources/views/notifications/_ModalExample.blade.php, (*9)

4- /public/css/notifications.css, (*10)

5- /public/js/notifications.js, (*11)

migrate notifications table

in your terminal, type : php artisan migrate, (*12)

Note: this library supposed that you already migrated the users table under users name in your database., (*13)

add CSRF_token

add CSRF_token to your head tag, add: php <meta name="csrf-token" content="{{ csrf_token() }}"> to your , (*14)

tag in html

How to use?

## 1- Modal (popup) 1- login in to your website, (*15)

2- add the following at the end of your page (default: app.blade.php):, (*16)

php {!! Notifier::break(0,30,0)->get()->first() !!} {!! Notifier::addStylesAndScriptes() !!}, (*17)

3- remove the first underscore (_) from /resources/views/notifications/_ModalExample.blade.php to be as /resources/views/notifications/ModalExample.blade.php. (this example is using bootstrap), (*18)

Note:, (*19)

- break($days,$hours,$minutes) is used to add a break time between notifications.

- the first underscore of your notification file tells Notifier to ignore this file.

- All of your notifications are located in ```/resources/views/notifications/```, each notification in each file (blade template) So, whenever you add a file to this folder, it means you are adding a new notification to your list.

4- visit your website :), (*20)

2- Card (list of notifications)

1- login in to your website, (*21)

2- add the following to your page (default: app.blade.php, recommended in navbar):, (*22)

```php // get list of notifications and diaply them as a list // navbar


//end of navbar, (*23)

//end of your page's body {!! Notifier::addStylesAndScriptes() !!} ```, (*24)

3- remove the first underscore (_) from /resources/views/notifications/_CardExample.blade.php to be as /resources/views/notifications/CardExample.blade.php. (this example is using bootstrap), (*25)

4- visit your website :), (*26)

The Versions

22/09 2017

dev-master

9999999-dev

  Sources   Download

22/09 2017

1.0.2

1.0.2.0

  Sources   Download

18/09 2017

1.0.1

1.0.1.0

  Sources   Download

13/09 2017

1.0.0

1.0.0.0

  Sources   Download