2024-05-06 21:37:26 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
|
|
use App\Http\Controllers\Dash\IndexController;
|
|
|
|
use App\Http\Controllers\Dash\AuthController;
|
2024-05-06 23:09:24 +02:00
|
|
|
use App\Http\Controllers\Front\StartController;
|
2024-05-06 21:37:26 +02:00
|
|
|
use App\Http\Controllers\Theming\ThemeController;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
|
|
|
|
class RouteController extends Controller
|
|
|
|
{
|
|
|
|
protected $dash;
|
|
|
|
protected $auth;
|
|
|
|
protected $theme;
|
2024-05-06 23:09:24 +02:00
|
|
|
protected $front;
|
2024-05-06 21:37:26 +02:00
|
|
|
|
|
|
|
public function __construct(
|
|
|
|
IndexController $indexController,
|
|
|
|
AuthController $authController,
|
|
|
|
ThemeController $themeController,
|
2024-05-06 23:09:24 +02:00
|
|
|
StartController $startContoller,
|
2024-05-06 21:37:26 +02:00
|
|
|
) {
|
|
|
|
$this->dash = $indexController;
|
|
|
|
$this->auth = $authController;
|
|
|
|
$this->theme = $themeController;
|
2024-05-06 23:09:24 +02:00
|
|
|
$this->front = $startContoller;
|
2024-05-06 21:37:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function get($first = null, $second = null, $third = null, $fourth = null)
|
|
|
|
{
|
|
|
|
if (isset($first) && !is_numeric($first)) {
|
|
|
|
switch ($first) {
|
|
|
|
case 'dashboard':
|
|
|
|
if (isset($second)) {
|
|
|
|
return $this->dash->init($second, $third, $fourth);
|
|
|
|
} else {
|
|
|
|
return $this->dash->login();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'theme':
|
|
|
|
if (isset($second)) {
|
|
|
|
return $this->theme->getView($third);
|
|
|
|
} else {
|
|
|
|
return $this->theme->start();
|
|
|
|
}
|
|
|
|
break;
|
2024-05-06 23:09:24 +02:00
|
|
|
case 'tags':
|
|
|
|
case 'archives':
|
|
|
|
return $this->front->page($first, $second, $third);
|
2024-05-06 21:37:26 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else {
|
2024-05-06 23:09:24 +02:00
|
|
|
return $this->front->index($first, $second, $third);
|
2024-05-06 21:37:26 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function post(Request $request)
|
|
|
|
{
|
|
|
|
switch ($request->path()) {
|
|
|
|
case 'login':
|
|
|
|
return $this->auth->enter($request);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|