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 ?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you generate urls?

778


What is routing in laravel 5 and how we can use it?

661


Explain how to register a service provider via composer in laravel?

634


What is auth :: routes ();?

675


How do I add a 3rd party package to your application like laravel-emoji?

638


How to create custom library in laravel?

731


What is helper function in laravel?

745


How to Redirecting to Controller Actions in Laravel ?

1240


Explain about input() method.

912


How do I register an artisan command?

697


How to do environment configuration in laravel.

737


What is Middleware Parameters ?

1254


Name aggregates methods of query builder.

705


Explain reverse routing in laravel.

751


How to get current route name?

664