2016-03-25 01:18:05 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
2018-11-01 19:59:50 -07:00
|
|
|
use App\Models\Setting;
|
|
|
|
use App\Events\SettingSaved;
|
|
|
|
use App\Listeners\LogListener;
|
|
|
|
use Illuminate\Support\Facades\Cache;
|
2016-12-14 04:32:24 -08:00
|
|
|
use Illuminate\Support\Facades\Event;
|
2018-09-10 07:40:26 -07:00
|
|
|
use App\Listeners\CheckoutableListener;
|
2016-03-25 01:18:05 -07:00
|
|
|
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
|
|
|
|
|
|
|
class EventServiceProvider extends ServiceProvider
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The event listener mappings for the application.
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
protected $listen = [
|
2018-07-16 23:49:08 -07:00
|
|
|
|
|
|
|
'Illuminate\Auth\Events\Login' => [
|
|
|
|
'App\Listeners\LogSuccessfulLogin',
|
|
|
|
],
|
|
|
|
|
|
|
|
'Illuminate\Auth\Events\Failed' => [
|
|
|
|
'App\Listeners\LogFailedLogin',
|
|
|
|
],
|
|
|
|
];
|
|
|
|
|
2018-07-21 04:54:30 -07:00
|
|
|
/**
|
|
|
|
* The subscriber classes to register.
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
protected $subscribe = [
|
2018-09-10 07:40:26 -07:00
|
|
|
LogListener::class,
|
|
|
|
CheckoutableListener::class
|
2018-07-21 04:54:30 -07:00
|
|
|
];
|
2016-03-25 01:18:05 -07:00
|
|
|
|
|
|
|
/**
|
2016-12-14 04:32:24 -08:00
|
|
|
* Register any events for your application.
|
2016-03-25 01:18:05 -07:00
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2016-12-14 04:32:24 -08:00
|
|
|
public function boot()
|
2016-03-25 01:18:05 -07:00
|
|
|
{
|
2016-12-14 04:32:24 -08:00
|
|
|
parent::boot();
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2018-11-01 19:59:50 -07:00
|
|
|
/**
|
|
|
|
* Clear the LDAP settings cache when the settings model is saved
|
|
|
|
*/
|
|
|
|
Event::listen(SettingSaved::class, function () {
|
|
|
|
Cache::forget(Setting::APP_SETTINGS_KEY);
|
|
|
|
Cache::forget(Setting::SETUP_CHECK_KEY);
|
|
|
|
});
|
2016-03-25 01:18:05 -07:00
|
|
|
}
|
|
|
|
}
|