2017 © Pedro Peláez
 

laravel-package laranotify

A feature-rich laravel package that turns bootstrap notify jQuery plugin to dynamic notifications, alerts and blockables.

image

coderatio/laranotify

A feature-rich laravel package that turns bootstrap notify jQuery plugin to dynamic notifications, alerts and blockables.

  • Tuesday, April 10, 2018
  • by josiahoyahaya
  • Repository
  • 0 Watchers
  • 7 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Laranotify

License , (*1)

The most advanced laravel package to dynamically display beautiful and elegant alert messages, blockables and notifications on screen. This is built with fluency in mind--meaning, you can chain as many methods as you want. Lots of functionalities are available. See demos, (*2)

It's built on top of Bootstrap notify or growl plugin. It comes with all methods in the plugin with lots of additional advanced methods. It therefore, requires you to have bootstrap installed on your project. However, customizing the template, gives your users different looks. Read about template customization under templates section., (*3)

Note: To start building your custom template, it's advisable to publish a sample to your view directory. When published, the sample template will be copied to laranotify directory inside your views folder. Learn about template publishing here., (*4)

Installation

Laranotify installation should be done via composer. Require coderatio/laranotify in your project's composer.json file OR, (*5)

Do composer require coderatio/laranotify on your terminal or command prompt if you are on Windows OS., (*6)

Provider and Aliases

If your Laravel installed version is less than 5.5, you will need to manually register the service provider and aliases. The provider and aliases are auto-discovered in version 5.5 and above., (*7)

To register the package service provider and aliases, open your app.php in config directory of your laravel installation then copy and paste:, (*8)

// Laranotify provider
Coderatio\Laranotify\LaranotifyServiceProvider::class,

Under your providers array., (*9)

Then in your aliases array, copy and paste:, (*10)

// Laranotify aliases
'Notify' => Coderatio\Laranotify\Facades\Notify::class,
'Laranotify' => Coderatio\Laranotify\Facades\Laranotify::class,

The aliases are Facades that helps you bind non static methods as static to the package service class. E.g, (*11)

Notify::success('This is a message'); 
 ```

# Publishing
The package has configuration and assets files that needs to be published to your app public directory. To publish these files, run;

```vim 
php artisan vendor:publish --tag=laranotify-required

on your command line., (*12)

Header and footer

Finally, call notify_header() function at the head tag and notify_footer() after your bootstrap JavaScript file to register laranotify assets in your project. This step is required., (*13)

e.g, (*14)

<head>
{{ notify_header() }}

</head>

Note: If you want to use the included Bootstrap css file, pass true as a parameter to the function like this:, (*15)

 {{ notify_header(true) }}
{{ notify_footer() }}

</body>

Note: If you want to use the included Bootstrap and jQuery files, pass true as a parameter to the function like this:, (*16)

 {{ notify_footer(true) }}

For these files to be properly loaded in your project, you will need to run php artisan vendor:publish --tag=laranotify-foundations on your command line or prompt., (*17)

Usage via Facades

Notify::message ('I am a simple notification from laranotify');
// You've just created your first notification.

You can then chain other methods to it. For example, if i want to change the delay period, i will do this: php Notify::success('I am a simple notification from laranotify')->delay(6000); // 6000 = 6secs. We included two facades for conveniences. You can choose to use either of them., (*18)

Usage via helpers

There are two helper functions provided to help you get started out of the box. The helper functions return the instance of the package service class., (*19)

/**
* @param (string) $message
*/
notify();

This helper takes only one argument which is your message. You may use the message method or notify types methods e.g error, info e.t.c by chaining to the helper function and many other once., (*20)

/**
* @param (string) $message
*/
laranotify();
````
Same as notify helper above.

```php
notify('Hello World'); 
// OR
laranotify('Hello World');

Will display Hello World on screen with default bootstrap info alert type., (*21)

To display a different type of alert , say error alert, chain error method to a helper or type method and pass any bootstrap alert class or your custom class to it. E.g, (*22)

notify()->error('There was an error!'); 
 // OR
notify('There was an error!')->type('danger');

Demos

, (*23)

Attributions

We deeply want to appreciate the creator of Bootstrap notify or growl plugin Robert McIntosh. Without which, there wouldn't have been this awesome package., (*24)

Documentation

Full documentation can be found here., (*25)

The MIT License (MIT) Copyright (c) 2018 Coderatio, (*26)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:, (*27)

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software., (*28)

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE., (*29)

The Versions

10/04 2018

dev-master

9999999-dev

A feature-rich laravel package that turns bootstrap notify jQuery plugin to dynamic notifications, alerts and blockables.

  Sources   Download

MIT

The Requires

 

by Josiah Ovye Yahaya

laravel notifier notify laravel framework lara laravel notification coderatio code9ja larnotify laranotify bootstrap notify

05/03 2018

dev-v0.1-patch

dev-v0.1-patch

A feature-rich laravel package that turns bootstrap notify jQuery plugin to a dynamic notification, alert and blockable.

  Sources   Download

MIT

The Requires

 

by Josiah Ovye Yahaya

laravel notifier notify laravel framework lara laravel notification coderatio code9ja larnotify laranotify bootstrap notify

02/03 2018

v0.1

0.1.0.0

The most advanced laravel package to dynamically display beautiful and elegant alert messages, blockables and notifications on screen. This is built with fluency in mind--meaning, you can chain as many methods as you want. Lots of functionalities are available.

  Sources   Download

MIT

The Requires

 

by Josiah Ovye Yahaya

laravel notifier notify laravel framework lara laravel notification coderatio code9ja larnotify laranotify bootstrap notify