NCORE_Smart_Firewall/routes/web.php

43 lines
1.4 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()) {
return redirect()->route('login');
2024-12-19 05:53:50 +00:00
} else {
return redirect()->route('dashboard');
2024-12-19 05:53:50 +00:00
}
});
Route::get('auth/',[\App\Http\Controllers\SmartController::class, 'index'])->name('login');
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');
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');
2024-12-19 08:02:32 +00:00
});