31 lines
970 B
PHP
31 lines
970 B
PHP
<?php
|
|
|
|
use App\Http\Controllers\LoginController;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Web Routes
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Here is where you can register web routes for your application. These
|
|
| routes are loaded by the RouteServiceProvider within a group which
|
|
| contains the "web" middleware group. Now create something great!
|
|
|
|
|
*/
|
|
|
|
Route::get('/', function () {
|
|
return view('welcome');
|
|
});
|
|
|
|
Route::get('/user', function () {
|
|
$user = Auth::user();
|
|
return view("user", ["user"=>$user]);
|
|
})->middleware("auth");
|
|
|
|
Route::view("/login", "login");
|
|
|
|
Route::post('/login', [LoginController::class, "authenticate"])->name("login");
|
|
Route::post('/register', [LoginController::class, "register"])->name("register");
|
|
Route::any("/logout", [LoginController::class, "logout"])->name("logout");
|