phpvms/app/Contracts/Listener.php
Nabeel S 3ebf4f2924
Custom user fields #711 (#772)
Custom user fields during registration and profile edit #711
2020-08-11 17:48:51 -04:00

23 lines
446 B
PHP

<?php
namespace App\Contracts;
use Illuminate\Contracts\Events\Dispatcher;
abstract class Listener
{
public static $callbacks = [];
/**
* Sets up any callbacks that are defined in the child class
*
* @param $events
*/
public function subscribe(Dispatcher $events): void
{
foreach (static::$callbacks as $klass => $cb) {
$events->listen($klass, static::class.'@'.$cb);
}
}
}