Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laranotify Laravel Package

coderatio/laranotify

Advanced Laravel notifications/alerts built on Bootstrap Notify/Growl. Chain fluent methods to show elegant on-screen messages, blockables, and notifications, with template customization and publishable sample views.

View on GitHub
Deep Wiki
Context7

layout: single

Introduction

Laranotify is the most advanced and recommended laravel package that redefines the way alert messages or notifications are displayed on screen.

It's built on top of the popular Bootstrap notify plugin by Robert McIntosh. Every method found there in the plugin is included in this awesome package. The package has added the ability to create custom templates apart from the type provided by Robert. However, customizing the template, gives your users different looks. Read about template customization under templates section.

Note: To start building your custom templates, it’s advisable to publish the samples provided by the package to your view directory. Learn more about this here

When published, the sample templates will be copied to views/vendor/vendor folder.

Provider

The package provider is auto-discovered if you are using Laravel 5.5 and above. If your version is less than 5.5, kindly add this line to your config/app.php file under providers array.

/**
* Laranotify provider.
*
*/

Coderatio\Laranotify\LaranotifyServiceProvider::class,

Aliases (Facades)

The package comes with two facades. If you want to use them, kindly the code below to your config/app.php file under aliases array.

/**
* Laranotify aliases.
*
*/

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

Publishing

The package has configuration and assets files that needs to be published to your app public directory. To publish these files, run this on your terminal:

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

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.

e.g

Header

notify_header();

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

notify_header(true);

Footer

notify_footer();

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

 notify_footer(true);

Note: For these files to be properly loaded in your project, you will need to run this on your terminal:

php artisan vendor:publish --tag=laranotify-foundations

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:

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.

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.

/**
* [@param](https://github.com/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.

/**
* [@param](https://github.com/param) (string) $message
*/
laranotify();
// Same as notify helper above. Take a look below.
notify('Hello World'); 
// OR
laranotify('Hello World');

Will display Hello World on screen with default bootstrap info alert type.

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

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

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.

Components

  • This is an unordered list following a header.
  • This is an unordered list following a header.
  • This is an unordered list following a header.
Header 5
  1. This is an ordered list following a header.
  2. This is an ordered list following a header.
  3. This is an ordered list following a header.
Header 6
head1 head two three
ok good swedish fish nice
out of stock good and plenty nice
ok good oreos hmm
ok good zoute drop yumm

There's a horizontal rule below this.


Here is an unordered list:

  • Item foo
  • Item bar
  • Item baz
  • Item zip

And an ordered list:

  1. Item one
  2. Item two
  3. Item three
  4. Item four

And a nested list:

  • level 1 item
    • level 2 item
    • level 2 item
      • level 3 item
      • level 3 item
  • level 1 item
    • level 2 item
    • level 2 item
    • level 2 item
  • level 1 item
    • level 2 item
    • level 2 item
  • level 1 item

Small image

Large image

Definition lists can be used with HTML syntax.

Long, single-line code blocks should not wrap. They should horizontally scroll if they are too long. This line should be long enough to demonstrate this.
The final element.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle