NCORE_Smart_Firewall/routes/web.php

34 lines
1.0 KiB
PHP
Raw Normal View History

2024-12-19 05:53:50 +00:00
<?php
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Route;
Route::get('/', function () {
return redirect('cp');
});
2024-12-19 08:02:32 +00:00
// The Login form when you are not Logged in
2024-12-19 05:53:50 +00:00
Route::Group(['prefix' => 'cp', 'middleware' => 'web'], function () {
Route::get('/', function (\Illuminate\Http\Request $request) {
if (!Auth::check()) {
2024-12-19 06:05:02 +00:00
return redirect()->route('auth');
2024-12-19 05:53:50 +00:00
} else {
2024-12-19 08:02:32 +00:00
return redirect()->route('internal');
2024-12-19 05:53:50 +00:00
}
});
2024-12-19 06:05:02 +00:00
Route::get('auth/',[\App\Http\Controllers\SmartController::class, 'index'])->name('auth');
2024-12-19 05:53:50 +00:00
});
2024-12-19 08:02:32 +00:00
// Calls for Controllers
Route::Group(['prefix' => 'call', 'middleware' => 'web'], function () {
Route::post('login', [\App\Http\Controllers\AuthController::class, 'authenticate'])->name('post_login');
});
// Internal Area when do you have permissions and logged in
Route::Group(['prefix' => 'internal', 'middleware' => 'auth'], function () {
Route::get('dashboard/', [\App\Http\Controllers\SmartController::class, 'dashboard'])->name('dashboard');
});