forked from projects/fipamo
ro
36d04c8f68
service classes are beginning to swell as there functionality is being fleshed out, so a new organizational structure was needed to make sure class sizes don't become too large and to increase site managability and legibilty as more features get added and the code base grows. data is for retrieving, managing site information, assets interact with external files and upkeep is for maintenance. some additional tweaks were also made to the options menu template to prep it for it's transition to a toolbar component
71 lines
2 KiB
PHP
71 lines
2 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Services\Data\AuthService;
|
|
use Illuminate\Http\Request;
|
|
|
|
class RouteController extends Controller
|
|
{
|
|
protected $dash;
|
|
protected $gate;
|
|
protected $theme;
|
|
protected $front;
|
|
protected $auth;
|
|
|
|
public function __construct(
|
|
DashController $dashController,
|
|
AuthController $authController,
|
|
ThemeController $themeController,
|
|
FrontController $frontController,
|
|
AuthService $authService,
|
|
) {
|
|
$this->dash = $dashController;
|
|
$this->gate = $authController;
|
|
$this->theme = $themeController;
|
|
$this->front = $frontController;
|
|
$this->auth = $authService;
|
|
}
|
|
|
|
public function get($first = null, $second = null, $third = null, $fourth = null)
|
|
{
|
|
if (isset($first) && !is_numeric($first)) {
|
|
switch ($first) {
|
|
case 'dashboard':
|
|
if ($this->auth::status()) {
|
|
return $this->dash->init($second, $third, $fourth);
|
|
} else {
|
|
return $this->dash->login();
|
|
}
|
|
break;
|
|
case 'theme':
|
|
if ($this->auth::status()) {
|
|
if (isset($second)) {
|
|
return $this->theme->getView($third);
|
|
} else {
|
|
return $this->theme->start();
|
|
}
|
|
} else {
|
|
return $this->dash->login();
|
|
}
|
|
break;
|
|
case 'tags':
|
|
case 'archives':
|
|
return $this->front->page($first, $second, $third);
|
|
break;
|
|
}
|
|
} else {
|
|
return $this->front->index($first, $second, $third);
|
|
}
|
|
}
|
|
|
|
public function post(Request $request)
|
|
{
|
|
switch ($request->path()) {
|
|
case 'login':
|
|
return $this->gate->enter($request);
|
|
break;
|
|
}
|
|
}
|
|
}
|