Skip to content

Instantly share code, notes, and snippets.

@Ghostscypher
Created February 2, 2022 12:17
Show Gist options
  • Save Ghostscypher/528fcda92c5174ac5b393f55521b443a to your computer and use it in GitHub Desktop.
Save Ghostscypher/528fcda92c5174ac5b393f55521b443a to your computer and use it in GitHub Desktop.
Oauth2-Server app web.php
<?php
use App\Http\Controllers\AuthController;
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::post('logout', function () {
auth()->logout();
return redirect('login');
});
Route::get('login', function(){
return view('auth.login');
})->name('login');
Route::get('register', function(){
return view('auth.register');
})->name('register');
Route::get('dashboard', function(){
return view('welcome');
})->name('dashboard')->middleware('auth');
Route::post('login', [AuthController::class, 'login'])->name('login.post');
Route::post('register', [AuthController::class, 'register'])->name('register.post');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment