30 lines
868 B
PHP
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');
|
|
|
|
});
|