use YourNamespace\SlackNotifier\SlackNotifier;
use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Events\Verified;
use Illuminate\Support\Facades\Event;
class EventServiceProvider extends ServiceProvider
{
public function boot()
{
parent::boot();
$eventToListen = config('slack-new-user-notifier.event_to_listen', 'Registered');
if ($eventToListen === 'Verified') {
Event::listen(Verified::class, function ($event) {
SlackNotifier::notify($event->user->email);
});
} else {
Event::listen(Registered::class, function ($event) {
SlackNotifier::notify($event->user->email);
});
}
}
}
php artisan vendor:publish --tag=config
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.