Lstm_prediction/lstm_prediction/routes/web.php

40 lines
1.3 KiB
PHP

<?php
use App\Http\Controllers\AuthController;
use App\Http\Controllers\PredictionController;
use App\Http\Controllers\SensorController;
use App\Http\Controllers\HomeController;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Auth;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Enjoy building your web app!
|
*/
// Route Authentication (Login, Logout, Register)
Auth::routes();
Route::get('/home', [HomeController::class, 'index'])->name('home');
Route::get('/', function () {
return redirect()->route('login');
});
// Route untuk Login & Logout
Route::get('/login', [AuthController::class, 'showLoginForm'])->name('login');
Route::post('/login', [AuthController::class, 'login']);
Route::post('/logout', [AuthController::class, 'logout'])->name('logout');
// Proteksi Dashboard & Data
Route::middleware('auth')->group(function () {
Route::get('/dashboard', [SensorController::class, 'index']);
Route::get('/data', [HomeController::class, 'data']);
});