<?php
namespace WPUmbrella\Controller\Plugin;

use WPUmbrella\Core\Models\AbstractController;

if (!defined('ABSPATH')) {
    exit;
}

class Data extends AbstractController
{
    public function executeGet($params)
    {
        try {
            wp_umbrella_get_service('RequestSettings')->adminLoaded();
            $plugins = wp_umbrella_get_service('PluginsProvider')->getPlugins();

            return $this->returnResponse($plugins);
        } catch (\Exception $e) {
            return $this->returnResponse([
                'code' => 'unknown_error',
                'messsage' => $e->getMessage()
            ]);
        }
    }
}
