Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace AppProviders;
- use IlluminateContractsEventsDispatcher as DispatcherContract;
- use IlluminateFoundationSupportProvidersEventServiceProvider as ServiceProvider;
- class EventServiceProvider extends ServiceProvider
- {
- /**
- * The event listener mappings for the application.
- *
- * @var array
- */
- protected $listen = [
- 'AppEventsSomeEvent' => [
- 'AppListenersEventListener',
- ],
- 'AppListenersLogout' => [
- 'AppListenersClearSessionAfterUserLogout'
- ],
- ];
- /**
- * Register any other events for your application.
- *
- * @param IlluminateContractsEventsDispatcher $events
- * @return void
- */
- public function boot(DispatcherContract $events)
- {
- parent::boot($events);
- }
- }
- <?php
- namespace AppListeners;
- use Session;
- use AppClassesHelper;
- class ClearSessionAfterUserLogout{
- public function handle(Logout $event){
- Session::flush();
- Session::set('configuration', NULL);
- Helper::unloadConfiguration();
- return redirect('/');
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement