Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть Part 9: Eloquent Events - Laravel 5.4 New Features

  • DevMarketer
  • 2017-02-20
  • 19143
Part 9: Eloquent Events - Laravel 5.4 New Features
EloquentEventsLaravelcodetutorialphpfeatures
  • ok logo

Скачать Part 9: Eloquent Events - Laravel 5.4 New Features бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно Part 9: Eloquent Events - Laravel 5.4 New Features или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

  • Информация по загрузке:

Cкачать музыку Part 9: Eloquent Events - Laravel 5.4 New Features бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео Part 9: Eloquent Events - Laravel 5.4 New Features

In Laravel 5.4 we can now tie eloquent events to our normal event classes. This allows us to tuck custom functionality to when new models and items are added to our database with very little effort.

While it might seem confusing at first for a newcomer, the events system requires several files but it makes sense once you wrap your head around it.

The file that controls all events is the EventServiceProvider. This is the file that displays all the events to listen for and the listeners to fire when the event is triggered. You can set up these relationships in a basic associated array format, with as many listeners as you want tied to a specific event.

Once you set up the relationship you can generate the files needed, by using the artisan console command:

php artisan event:generate

This will create an Events and a Listeners folder with the new events and listeners files inside them.

We will customize the event file only because we want to tell the event to pass a user eloquent object along to the listener, otherwise there would be no other need to customize this file. By customizing this file, we tell it to pass the user object to the listener.

In the listener, we can tell the listener which code to execute by putting the code in the Handler() function. For this tutorial, this is where we add the Mail command.

This is the basic event/listener relationship, but when we want to tie it to your Eloquent events, then we establish the connection in our model. In our case, it is the User model. In the user model, we will create a new protected attribute called $events and then set up the eloquent event to our custom Event Classes as shown in the video.

Now when the eloquent event fires, it triggers our custom Event class and then fires the listener.

For more information about Events/Listeners in general:
https://laravel.com/docs/5.4/events

For more information about Eloquent Events:
https://laravel.com/docs/5.4/eloquent...

Комментарии

Информация по комментариям в разработке

Похожие видео

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

Контакты для правообладателей [email protected]