public function attachEvents()
    {
        $appEvents = $this->container->get('event')->getAppEvents();

        if (!empty($appEvents)) {
            foreach ($appEvents as $event => $namespace) {
                // attach all before and after event to handler
                $this->container->get('event')->attach("$event", $namespace);
            }
        }
    }