listener.stub
TLDR
This file is a stub file used in the Illuminate/Foundation/Console/stubs directory of the Demo Projects project. It is a PHP file that contains a class definition for an event listener. It includes a constructor and a method for handling events.
Classes
Listener
The Listener class is an event listener class. It is used to handle events and should implement the ShouldQueue interface if it needs to be queued for later processing. The class has a constructor that is executed when the class is instantiated. It also has a handle method that is responsible for handling events. It takes an event object as a parameter.
<?php
namespace {{ namespace }};
use {{ eventNamespace }};
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
class {{ class }}
{
/**
* Create the event listener.
*/
public function __construct()
{
//
}
/**
* Handle the event.
*/
public function handle({{ event }} $event): void
{
//
}
}