So far in this chapter, we've exclusively reached for Mailable
classes to send emails; however, there's an alternative approach that you might consider as well. A Notification
class can be used to notify a user in response to some action they took on your website. The difference is in how the user is notified. Sure, we can send them an email, but we could also notify them via a text message, or Slack notification, or even as a physical post card!
app/Models
directory. This means an App\Post
namespace should now be App\Models\Post
.