NCORE_Smart_Firewall/routes/web.php

34 lines
1.0 KiB
PHP

<?php
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Route;
Route::get('/', function () {
return redirect('cp');
});
// The Login form when you are not Logged in
Route::Group(['prefix' => 'cp', 'middleware' => 'web'], function () {
Route::get('/', function (\Illuminate\Http\Request $request) {
if (!Auth::check()) {
return redirect()->route('auth');
} else {
return redirect()->route('internal');
}
});
Route::get('auth/',[\App\Http\Controllers\SmartController::class, 'index'])->name('auth');
});
// 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');
});