vendredi 2 mars 2018

Laravel Event Dispatcher in Controller

Good Day Guys .. I am just new to Laravel Events and I just wanna ask if what is the recommended way to use events in controller .. Is it by use of facades or by using Dependency Injection ..

Currently here's my code

use Illuminate\Events\Dispatcher;

public function __construct(Dispatcher $event){

        $this->event = $event;

}

$this->event('event.name', $variable);

for now this is working, but is this the right way to fire an event??



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire