Let's talk about Events and Listeners

  Рет қаралды 1,893

Laravel

Laravel

Күн бұрын

Пікірлер: 10
@kmbo_0
@kmbo_0 8 сағат бұрын
I never tried to use Events or Listners before as I was doing everything inside my Action class, but after watching this video, I think I'll give it a try. Very well explained.
@Pekz00r
@Pekz00r Сағат бұрын
I would strongly recommend against events and listeners in almost almost all cases. You should stick probably use Actions instead. The problem is that Events and listeners gets really messy and it is really hard to follow the code and see what side effects code has because events and listeners are too loosely coupled. If your actions gets too big and unwieldy, it is much better to just split your actions into several actions that calls each other instead. Jeffery Way explains this point very nicely in this video: kzbin.info/www/bejne/Y5bdgK1sq7V_pdE
@brunosadventures3801
@brunosadventures3801 4 сағат бұрын
For me working with events makes the code less understandable and readable. It is harder to find the code that is executed when a ticket is created. If you need more abstraction, just create an extra funtion or class with methods. Events can be handy for vendor packages where the event and listener code is not in the same repo.
@matias.krabzik
@matias.krabzik 8 сағат бұрын
Just in time! :D
@code75581
@code75581 8 сағат бұрын
Thanks for the video. Does the code inside the listener still run inside the job being processed ? If not what’s then the benefit of just abstracting The code ?
@mrozbarry
@mrozbarry 7 сағат бұрын
I believe it would run in the same fpm process, but I'm not sure if it runs inline. Either way, the main purpose is so the flow of code is isolated, you could test the user notification event listener in isolation, and your job code would only need to assert that the event was dispatched.
@dominikbetlej7114
@dominikbetlej7114 8 сағат бұрын
Thx!
@im_imon
@im_imon 7 сағат бұрын
Which font and theme is it ?
@helderneves91
@helderneves91 6 сағат бұрын
nice ears men :D
Why C Programming Is Awesome
8:34
Chris Hawkes
Рет қаралды 562 М.
黑的奸计得逞 #古风
00:24
Black and white double fury
Рет қаралды 29 МЛН
Osman Kalyoncu Sonu Üzücü Saddest Videos Dream Engine 269 #shorts
00:26
啊?就这么水灵灵的穿上了?
00:18
一航1
Рет қаралды 106 МЛН
Não sabe esconder Comida
00:20
DUDU e CAROL
Рет қаралды 58 МЛН
Build Your Own Custom Auth System with Fortify
20:14
Laravel
Рет қаралды 7 М.
We Love PHP Attributes
10:02
Laravel
Рет қаралды 10 М.
I WON!!!!! I WON!!!!!!!!!!!!!!
32:29
GothamChess
Рет қаралды 92 М.
Making Minecraft 100x faster (by rewriting it in Rust)
17:02
Theo - t3․gg
Рет қаралды 27 М.
Presentation Good/Bad Examples
2:29
Husain S.
Рет қаралды 3,5 МЛН
Why I Don't Use Else When Programming
10:18
Web Dev Simplified
Рет қаралды 1,2 МЛН
iPhone or Samsung?
0:18
ARSTANOTT
Рет қаралды 3,5 МЛН
Это самый популярный гаджет в мире
0:20
Handy remote!
0:25
LeraKek
Рет қаралды 1,9 МЛН
Фокус-Покус AirPods
0:57
Listen_pods
Рет қаралды 1 МЛН
Xiaomi or Samsung #colormixing #satisfying #sharkzhan
0:23
Shark Zhan
Рет қаралды 1,8 МЛН
Самое большое защитное стекло
0:43
Romancev768
Рет қаралды 335 М.