NCORE_Smart_Firewall/routes/web.php

43 lines
1.4 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('login');
} else {
return redirect()->route('dashboard');
}
});
Route::get('auth/',[\App\Http\Controllers\SmartController::class, 'index'])->name('login');
});
// 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');
Route::get('caller/', [\App\Http\Controllers\SmartController::class, 'caller'])->name('caller');
Route::get('caller/logs', [\App\Http\Controllers\SmartController::class, 'caller_log'])->name('caller_log');
// Post Request for Internal Handling
Route::post('caller/add', [\App\Http\Controllers\PostHandler::class, 'caller_add'])->name('caller_add');
});