Advertisement
Guest User

Untitled

a guest
Jul 26th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. <?php
  2.  
  3. namespace AppProviders;
  4.  
  5. use IlluminateContractsEventsDispatcher as DispatcherContract;
  6. use IlluminateFoundationSupportProvidersEventServiceProvider as ServiceProvider;
  7.  
  8. class EventServiceProvider extends ServiceProvider
  9. {
  10. /**
  11. * The event listener mappings for the application.
  12. *
  13. * @var array
  14. */
  15. protected $listen = [
  16. 'AppEventsSomeEvent' => [
  17. 'AppListenersEventListener',
  18. ],
  19. 'AppListenersLogout' => [
  20. 'AppListenersClearSessionAfterUserLogout'
  21. ],
  22. ];
  23.  
  24. /**
  25. * Register any other events for your application.
  26. *
  27. * @param IlluminateContractsEventsDispatcher $events
  28. * @return void
  29. */
  30. public function boot(DispatcherContract $events)
  31. {
  32. parent::boot($events);
  33. }
  34. }
  35.  
  36. <?php
  37. namespace AppListeners;
  38. use Session;
  39. use AppClassesHelper;
  40.  
  41. class ClearSessionAfterUserLogout{
  42. public function handle(Logout $event){
  43. Session::flush();
  44. Session::set('configuration', NULL);
  45. Helper::unloadConfiguration();
  46. return redirect('/');
  47. }
  48. }
  49. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement