/** * Register any other events for your application. * * @param \Illuminate\Contracts\Events\Dispatcher $events * @return void */ public function boot(DispatcherContract $events) { parent::boot($events); \Event::listen('*', function () { $event = \Event::firing(); if (starts_with($event, "Uniamo\\Events")) { // logger("Event fired: " . $event . "\n"); \Cache::flush(); // logger("Cleared cache"); } }); }
<?php /* |-------------------------------------------------------------------------- | Event Handlers |-------------------------------------------------------------------------- | | Here is where you can register event handlers that subscribe to | particular event types | */ Event::subscribe('Zeropingheroes\\Lanager\\Domain\\Users\\UserHandler'); // Log all service actions Event::listen('lanager.services.*', function ($parameters) { $eventName = str_replace('lanager.services.', '', Event::firing()); $username = is_object(Auth::user()) ? Auth::user()->username : '******'; Log::debug(e($username) . ': ' . $eventName, $parameters); });
public function getEventName() { $this->event = \Event::firing(); return $this->event; }
<?php /* |-------------------------------------------------------------------------- | Application Custom Events |-------------------------------------------------------------------------- | | All raw bindings go here = (could also use service providers) | */ /** LOGIN **/ Event::listen('synlogin.*', function ($login) { if (Event::firing() === "synlogin.success") { $u_info = $login->getUserInfo(); $user_id = isset($u_info['id']) ? $u_info['id'] : "nothing"; Log::info('Login Succeeded--> User:'******'Login Problems: Auth--> ' . $auth_problems . ' :: Client Data--> ' . $client_problems . ' :: Validation--> ' . $vld_problems); //Log::warning('Login Attempt: Attempts Left--> '.($login->getThrottleInfo()['attempts_left']).' Throttle Owner--> '.($login->getThrottleInfo()['throttle_owner'])); } } });