fipamo/app/Http/Controllers/API/SettingsAPIController.php
ro eda377aba3
publish site from settings active
with the setting page set up, now the the settings api can be added,
beginning with the ability to render all files from settings.

the base settings api class is set up, so now the rest of the methods
can be added
2024-03-19 15:34:01 -06:00

28 lines
718 B
PHP

<?php
namespace App\Http\Controllers\API;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Services\SettingsService;
use App\Services\RenderService;
class SettingsAPIController extends Controller
{
protected $settings;
protected $render;
public function __construct(SettingsService $settingsService, RenderService $renderService)
{
$this->settings = $settingsService;
$this->render = $renderService;
}
public function publish(Request $request)
{
$body = json_decode($request->getContent());
$result = $this->render->publishAll();
return response()->json($result)->header('Content-Type', 'application/json');
}
}