-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweb.php
44 lines (37 loc) · 1.44 KB
/
web.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
use App\Http\Controllers\FavoriteController;
use App\Http\Controllers\QuoteController;
use Illuminate\Foundation\Application;
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 within a group which
| contains the "web" middleware group. Now create something great!
|
*/
require __DIR__.'/auth.php';
Route::get('/', function () {
return Inertia::render('Welcome', [
'canLogin' => Route::has('login'),
'canRegister' => Route::has('register'),
'laravelVersion' => Application::VERSION,
'phpVersion' => PHP_VERSION,
]);
});
Route::group(
['prefix' => 'dashboard', 'middleware' => ['auth', 'verified'], 'as' => 'dashboard.'],
function () {
Route::get('/', fn () => Inertia::render('Dashboard'))->name('main');
Route::get('/quotes', [QuoteController::class, 'index'])->name('quotes');
Route::resource('/favorites', FavoriteController::class);
}
);
/*
Route::get('/dashboard', fn () => Inertia::render('Dashboard'))->middleware(['auth', 'verified'])->name('dashboard');
Route::get('/dashboard/quotes', [QuoteController::class, 'index'])->middleware(['auth', 'verified'])->name('quotes');
*/