03 - Long Controller Method - to Form Request and Observer
We found 19 results for "observers".
In this lesson, let's talk about caching. For example, categories will mostly stay the same or could not change for years or even ever
Multi-tenant application are pretty common these days, where database are entries can be accessed only by users who created them. In this article, I will show the simplest way to achieve it in Laravel.
If you have Observer events on updated/deleted rows, it's important to know that they are fired only when you update individual rows, and not when doing mass-update or mass-delete.
If you have a newly registered user, you may want to send a welcome email or perform some other action with that user's profile. In Laravel, I will show you three ways how to achieve it.
A little bit philosophical topic: when we're trying to offload some logic from the Controller to "somewhere", aren't we shooting ourselves in the foot, for the future?
Want to send an email notification whenever some record is added or changed? There are two ways. And, broadly speaking, we are talking about some event happening, and another class "reacting" to that event.
Files in the example:
Files in the example:
Files in the example:
If you use database transactions and Eloquent observers on one of the Models, you need to make sure that observers are fired only if the full transaction is successful.
I want to quickly show you an example of a method called before saving the data into the DB, and in both create and update occasions.
Files in the example:
Files in the example:
Files in the example:
Files in the example:
Files in the example:
Files in the example:
Files in the example: