Laravel Classroom image

Anil  Bist / Professional / Web Technology

 
To post your Question Join Classroom
 
Lesson Topics's No:-  First|1 | 2 | 3 | 4 | 5|Last
Lessons:-Events

12.2 Listen for an Event
To listen for an event we use the… yeah you probably guessed it. The listen() method. We
hand it the name of the event that we are looking for as a string, and as the second parameter a
closure to be performed when the event has been fired. The result of the closure will be passed
back as a response. Let’s take a look.
1 <?php
2
3 Event::listen('dinner.time', function() {
4 return 'thanks for the grub!';
5 });
If we now call $val = Event::first('dinner.time'); the value of $val will be thanks for
the grub!. Simple as that.

 
 
 
image
Anil  Bist

Skills    Laravel

Qualifications :- High School - SLV, College/University - Graphic Era Deemed Univ University,
Location :-Dehradun,Dehradun,Uttarakhand,India
Description:-

I started my Professional Journey in 2006 with one of the Web Development Company in Bangalore and my 1st framework was "Ruby on Rail" as Web development and delivered around 5+ Projects using this platform. Then came another dimension as JEE/Sturst framework, Gradually I realized that I want to build something on my own and give my passion and energy on creating something different a
Explore

 

  Students (0)