Adding Notifications & LaraFlash Package (Ep 25) - Build an Advanced Blog & CMS

DevMarketer Guide 8 years ago

Description

In this video we add the LaraFlash package to more easily manage our flash notifications. This powerful plugin allows us to easily add flash notifications to our Laravel app, including attaching additional information like priority, message type (success, info, danger, warning, snackbar, etc), and titles. You can add as many LaraFlash notifications to the same request as you want and they will all be available to use in the view. There are even powerful methods to sort the messages by priority or type.

Once LaraFlash is set up, then we set up our javascript notifications through Vue. We will do this by creating a new Notifications Vue.js object to manage all our notifications and set up the "mount" method to run all our LaraFlash notifications upon load.

Once all the notifications run, we can also trigger custom client-side notifications at any time by calling the notification methods such as .toast(), .success() and so forth.

At the end, we tie into the "copied" event that is triggered when our slug is copied to the clipboard and we show a notification with custom information about the copy request.

===== LINKS =====

LaraFlash Laravel Package
https://github.com/DevMarketer/LaraFlash

Get Code Snippet for Toast.Blade.php:
https://gist.github.com/jacurtis/9fa687e8f7512bb197decce7ffc30091

==== MORE FROM THIS SERIES . ====

Full Playlist for the "Building an Advanced Blog/CMS from Start to Finish" Series:
https://www.youtube.com/playlist?list=PLwAKR305CRO_cukAejlt5kz3pTtDMW_Cd


==== DOWNLOAD SOURCE CODE ====

Download Code from this Episode:
https://github.com/DevMarketer/DevMarketer/releases/tag/ep_25


==== FOLLOW ME ====

Subscribe for New Releases!

Subscribe to DevMarketer Insider
https://confirmsubscription.com/h/d/5EDC91CF554832D1

Twitter - http://twitter.com/_jacurtis
(ask me questions!)


==== QUESTIONS? ====

Leave a comment below and I or someone else can help you.
For quick questions you may also want to ask me on Twitter, I respond almost immediately.

Email me hello@jacurtis.com

Thanks for all your support!