Files
budget_analyser/routes/web.php
2024-01-25 14:00:48 +01:00

30 lines
868 B
PHP

<?php
use App\Http\Controllers\UserController;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Route;
use Inertia\Inertia;
/*
|--------------------------------------------------------------------------
| 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. Make something great!
|
*/
Route::get('/login', function () {
if (Auth::check()){return redirect('/');}
return Inertia::render('Auth/login');
})->name('login');
Route::post('/login', [UserController::class, 'login']);
Route::middleware(['auth'])->group(function(){
Route::get('/', function () {
return view('welcome');
})->name('home');
});