diff options
-rw-r--r-- | config/routes.php | 5 | ||||
-rw-r--r-- | src/Controllers/HomeController.php | 16 |
2 files changed, 17 insertions, 4 deletions
diff --git a/config/routes.php b/config/routes.php index 6cc0ce8b..e999d026 100644 --- a/config/routes.php +++ b/config/routes.php @@ -1,14 +1,11 @@ <?php -use Engelsystem\Http\Exceptions\HttpTemporaryRedirect; use FastRoute\RouteCollector; /** @var RouteCollector $route */ // Pages -$route->get('/', function () { - throw new HttpTemporaryRedirect(auth()->user() ? config('home_site') : 'login'); -}); +$route->get('/', 'HomeController@index'); $route->get('/credits', 'CreditsController@index'); // Authentication diff --git a/src/Controllers/HomeController.php b/src/Controllers/HomeController.php new file mode 100644 index 00000000..809593ce --- /dev/null +++ b/src/Controllers/HomeController.php @@ -0,0 +1,16 @@ +<?php + +namespace Engelsystem\Controllers; + +use Engelsystem\Http\Exceptions\HttpTemporaryRedirect; + +class HomeController extends BaseController +{ + /** + * @throws HttpTemporaryRedirect + */ + public function index() + { + throw new HttpTemporaryRedirect(auth()->user() ? config('home_site') : 'login'); + } +} |