public function deactivate($name)
    {
        $name = Container::get('hooks')->fire('model.plugin.deactivate.name', $name);
        $activePlugins = $this->manager->getActivePlugins();

        // Check if plugin is actually activated
        if (($k = array_search($name, $activePlugins)) !== false) {
            $plugin = DB::forTable('plugins')->where('name', $name)->find_one();
            if (!$plugin) {
                $plugin = DB::forTable('plugins')->create()->set('name', $name);
            }
            $plugin->set('active', 0);

            // Allow additionnal deactivate functions
            $this->manager->deactivate($name);

            $plugin = Container::get('hooks')->fireDB('model.plugin.deactivate', $plugin);
            $plugin->save();

            $this->manager->setActivePlugins();

            return $plugin;
        }
        return true;
    }