Implementing Global Toast with Toastr Package for Web Application — Laravel

Cerwyn Cahyono
The Startup
Published in
11 min readJun 7, 2020

--

Photo by Christopher Gower on Unsplash

Building a large-scale web application is very complicated. You and your teammates must pay attention to either big or little details so that your app works well. Plus, it would be best if you considered several things when typing some codes there. For example, is your code reusable? So that your teammates can use your code/functions you typed. Or is your code is scalable enough? So it would be much easier to maintain and make an improvement later. Yes, you know what I mean, we must think ahead. But remember, as a general rule of thumb from Jeffrey Way in one of his videos in Laracast, you don’t need to refactor the code unless it’s necessary. If you’re building a simple web application, then maybe leave it as simple as possible is the best choice. But when your app gets bigger and needs to do some refactoring there, you must do that and think way ahead.

As I mentioned earlier, we must pay attention to little details, especially when giving feedback to the users. We cannot assume that the users know what your server is doing, right? For example, when the users create a new post, then submit it. We should give them some feedback on whether their posts are already saved or if there’s an error while saving it. When providing feedback to the users, we have several ways to do that, but using a toast is the most common…

--

--

Cerwyn Cahyono
The Startup

PHP/Backend Engineer at Undercurrent Capital Pte Ltd — Data Science Enthusiast