forked from projects/fipamo
62 lines
1.7 KiB
PHP
62 lines
1.7 KiB
PHP
|
<?php
|
||
|
|
||
|
namespace App\Http\Controllers;
|
||
|
|
||
|
use App\Http\Controllers\Dash\IndexController;
|
||
|
use App\Http\Controllers\Dash\AuthController;
|
||
|
use App\Http\Controllers\Theming\ThemeController;
|
||
|
use Illuminate\Http\Request;
|
||
|
|
||
|
class RouteController extends Controller
|
||
|
{
|
||
|
protected $dash;
|
||
|
protected $auth;
|
||
|
protected $theme;
|
||
|
|
||
|
public function __construct(
|
||
|
IndexController $indexController,
|
||
|
AuthController $authController,
|
||
|
ThemeController $themeController,
|
||
|
) {
|
||
|
$this->dash = $indexController;
|
||
|
$this->auth = $authController;
|
||
|
$this->theme = $themeController;
|
||
|
}
|
||
|
|
||
|
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;
|
||
|
default:
|
||
|
dd('$first' . $first);
|
||
|
break;
|
||
|
}
|
||
|
} else {
|
||
|
dd('index');
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public function post(Request $request)
|
||
|
{
|
||
|
switch ($request->path()) {
|
||
|
case 'login':
|
||
|
return $this->auth->enter($request);
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
}
|