Notification alert using Bootstrap in laravel   –  with notify plugin

In this post we will learn how to implement notifiction in laravel using notify plugin its a bootstrap notification plugin type.

It is usefull to provide notification for error, warning ,  success and info messages.


Step 1: Install Laravel and Create Application

Step 2: Create Controller

Step 3: Create Notification blade file

Step 4: Create Route

Step 5: Run application

Create laravel application : using below composer command create new laravel application

composer create-project --prefer-dist laravel/laravel notifyapp

Get in laravel application

cd notifyapp

Create controller

Create a controller using artisan command, in controller function we will call blade(view) file, run below php artisan command for create controller.

php artisan make:controller notifyController

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Http\Requests;   

class notifyController extends Controller
    public function index(){

        session()->put('success','Success Notification message goes here!!!');  
        // session()->put('info','Info Notification message goes here!!!');  
        // session()->put('error','Erro Notification message goes here!!!');  
        // session()->put('warning','Warning Notification message goes here!!!');  
        return view('checknotification');  

Create view file inside resources\views\checknotification.php

<!DOCTYPE html>  
    <title> Notification Using Laravel </title>  
<div class="container">  
    <div class="row">  
        <div class="col-md-10 col-md-offset-1">  
            <div class="panel panel-default">  
                <div class="panel-body">  
                    Test Notification  

Create notification blade file for alert message resources\views\notification.blade.php

<script type="text/javascript" src="//"></script>
  <link rel="stylesheet" type="text/css" href="//">
  <link rel="stylesheet" type="text/css" href="">
  <script type="text/javascript" src=""></script>

<div class='notifications top-right'></div>  

        message: { text: "{{ Session::get('success') }}" }  
        message: { text: "{{ Session::get('info') }}" },  
        message: { text: "{{ Session::get('warning') }}" },  
        message: { text: "{{ Session::get('error') }}" },  

Create Route : Create route inside web.php for accessing controller function.


use Illuminate\Support\Facades\Route;
use App\Http\Controllers\notifyController;
| Web Routes
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!

Route::get('/', function () {
    return view('welcome');


Now run application using below command and access url

php artisan serve

Leave a Reply

Your email address will not be published. Required fields are marked *