55 lines
1.7 KiB
PHP
55 lines
1.7 KiB
PHP
<?php
|
|
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
use App\Http\Livewire\Game;
|
|
use App\Http\Livewire\Setup;
|
|
use App\Http\Controllers\SettingController;
|
|
use App\Http\Controllers\AuthController;
|
|
|
|
use App\Http\Controllers\Admin\AdminController;
|
|
use App\Http\Controllers\Admin\CardController;
|
|
use App\Http\Livewire\Form\CardForm;
|
|
|
|
use Illuminate\Support\Facades\Session;
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| 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 redirect()->route('setup');
|
|
});
|
|
|
|
Route::get('/setup', Setup::class)->name('setup');
|
|
|
|
route::get('/setup/{setting}', [ SettingController::class, "hash" ])->name('setup-hash');
|
|
|
|
Route::get('/game', Game::class)->name('game');
|
|
|
|
// Admin section
|
|
Route::prefix('admin')->group(function() {
|
|
|
|
// Auth
|
|
Route::get('/login', [AuthController::class, 'create'])->name('login');
|
|
Route::post('/login', [AuthController::class, 'store']);
|
|
|
|
Route::middleware(['auth'])->group(function() {
|
|
|
|
Route::get('/', [AdminController::class, 'index']);
|
|
|
|
Route::get('/cards', [CardController::class, 'index'])->name('admin.card.index');
|
|
Route::get('/cards/new', CardForm::class)->name('admin.card.create');
|
|
Route::get('/cards/{card}', CardForm::class)->name('admin.card.edit');
|
|
Route::delete('/cards/{card}', [CardController::class, 'destroy'])->name('admin.card.delete');
|
|
|
|
Route::post('/logout', [AuthController::class, 'destroy'])->name('logout');
|
|
});
|
|
});
|