Загрузка страницы

Events / Listeners - Laravel - The PHP Framework For Web Artisans

Events / Listeners - Laravel - The PHP Framework For Web Artisans
👍 Subscribe for more tutorials like this: https://www.youtube.com/channel/UCAo0zsTJa1Yu7MPNBhjCg7Q/

As the name implies listens for events that occur in your application and in order to grab that event, listener has to be present.

This means every listener has its event.

Most important suppose how will an event know which listener will be triggered once the event occurred.

So that event listener relation is defined inside app\Providers\EventServiceProvider.php

How it is useful in your application?

Let’s take an example to suppose you have an eCommerce platform and on every successful purchase you want to send mail to your customer that functionality you can make through event/listener.

Basically on every specific operation or you can say event you can trigger the listener
whether it will be triggering listener when member onboarded and sending welcome mail or sending slack notification

Through single artisan command, you can create Events / Listeners
*********************************************
php artisan make:listener BlogLogListener
php artisan make:event BlogLogEvent
*********************************************

⭐️ Want to learn more from me? Check out these links:

Blog: https://coderuck.com
Linkedin: https://www.linkedin.com/company/coderuck
Facebook: https://www.facebook.com/coderuck

Видео Events / Listeners - Laravel - The PHP Framework For Web Artisans канала Coderuck
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
5 января 2021 г. 16:15:44
00:09:43
Яндекс.Метрика