fipamo/app/Http/Controllers/Front/StartController.php
ro ceeb4a2573
page routing rework
routing needed more nuance than what was possible in the web routing
controller, so a new RouteContoller was created to identify requests and
then sending them to the correct controller to get the appropriatie page

this was necessary because routing the previous was erroring out because
when the system was looking for pages to display with dynamic page
creation it would get confused with prexisting routes and choose to
display whatever the Start Controller was capturing, ignoring routes
defined in the web controller.

but that's been cleaned up without having to re-write everything and
continues to use existing controllers
2024-05-06 13:37:26 -06:00

39 lines
1.1 KiB
PHP

<?php
namespace App\Http\Controllers\Front;
use App\Services\SettingsService;
use App\Http\Controllers\Controller;
use App\Services\AuthService;
class StartController extends Controller
{
protected $settings;
protected $auth;
public function __construct(SettingsService $settingsService, AuthService $authService)
{
$this->settings = $settingsService;
$this->auth = $authService;
}
public function index($first = 00, $second = 00, $third = 00)
{
$global = $this->settings->getGlobal();
//check if configs are present
if (file_exists(env('FOLKS_PATH')) && file_exists(env('SETTINGS_PATH'))) {
if ($global['dynamicRender'] == 'true') {
if (is_numeric($first)) {
dd('index');
} else {
dd('pages');
}
} else {
return response()->file('../public/index.html');
}
} else {
return view('back.init', ["status" => false, "title" => "Set Up"]);
}
}
}