Add Flash Notification After Create or Update Actions in Laravel Applications

In header,

$(document).ready(function() {

//check for notification
var message_title = “{{Session::get(‘message’)[‘title’]}}”;
var message_body = “{{Session::get(‘message’)[‘body’]}}”;
setTimeout(addNotification(message_title, message_body), 5000);

//set time out for the flash message..
}, 2000);


In aceplus.backend.functions.js, //need this js
function addNotification(title, text){
title: title,
text: text,
time: 3000
return false;


In index.blade.php, under header,
@if(count(Session::get(‘message’)) != 0)




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s