TraceDash/routes/auth.php

26 lines
886 B
PHP

<?php
use App\Http\Controllers\Auth\TwitchController;
use App\Http\Controllers\DashboardController;
use App\Http\Controllers\ViewerController;
use Illuminate\Support\Facades\Route;
Route::middleware('guest')->group(function () {
Route::get('auth/twitch', [TwitchController::class, 'redirect'])->name('login');
Route::get('auth/twitch/callback', [TwitchController::class, 'callback']);
});
Route::middleware('auth')->group(function () {
Route::get('/dashboard', [DashboardController::class, 'index'])
->name('dashboard');
Route::get('/channel/{channel}', [DashboardController::class, 'channel'])
->name('dashboard.channel');
Route::get('/viewer/{viewerId}', [ViewerController::class, 'index'])
->name('viewer');
Route::post('logout', [TwitchController::class, 'logout'])
->name('logout');
});