/** * Register the service provider. * * @return void */ public function register() { //SupportprogramsApplication SupportprogramsApplication::created(function ($supportprogram) { UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'SupportprogramsApplication_supportprogram', 'reference_id' => $supportprogram->id]); }); SupportprogramsApplication::updated(function ($supportprogram) { UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'SupportprogramsApplication_supportprogram', 'reference_id' => $supportprogram->id]); }); SupportprogramsApplication::deleted(function ($supportprogram) { UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'SupportprogramsApplication_supportprogram', 'reference_id' => $supportprogram->id]); }); }