Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Explain Events and Listeners ?



Explain Events and Listeners ?..

Answer / surbhi

Events and Listeners serve a great way to decouple a web application, since one event can have multiple listeners which are independent of each other.
The events folder created by the artisan command includes the following two files
1. : event.php
2. :SomeEvent.php.

Event.php

<?php
namespace AppEvents;
abstract class Event{
//
}
As mentioned above, event.php includes the basic definition of class Event and calls for namespace AppEvents. Please note that the user defined or custom events are created in this file.


SomeEvent.php

For example, if we need to initialize order variable in the constructor for registering an event, we can do it in the following way -

public function __construct(Order $order)
{
$this->order = $order;
}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Laravel PHP Framework Interview Questions

Tell me how to use insert statement in laravel?

0 Answers  


Is laravel a cms?

0 Answers  


List some features of laravel 5.0?

0 Answers  


What are cookies? How to get, set, distroy cookies in laravel?

0 Answers  


List out common artisan commands used in laravel.

0 Answers  


What is controller in laravel?

0 Answers  


Tell me how do I see all of the routes that are defined?

0 Answers  


What is meant by Retrieving Input ?

1 Answers  


What do you know about traits in laravel?

0 Answers  


What are Global Middleware and Route Middleware ?

0 Answers  


How to do subdomain routing in laravel?

0 Answers  


What do you understand by database migrations in laravel? How can we use it?

0 Answers  


Categories