Skip to content

Commit 8b1a240

Browse files
committed
Use Route::inertia directly
1 parent 27c8693 commit 8b1a240

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

routes/web.php

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
<?php
22

33
use Illuminate\Support\Facades\Route;
4-
use Inertia\Inertia;
54

6-
Route::get('/', function () {
7-
return Inertia::render('welcome');
8-
})->name('home');
5+
Route::inertia('/', 'welcome')->name('home');
96

10-
Route::middleware(['auth'])->group(function () {
11-
Route::get('dashboard', function () {
12-
return Inertia::render('dashboard');
13-
})->name('dashboard');
14-
});
7+
Route::inertia('/dashboard', 'dashboard')->name('dashboard')->middleware('auth');
158

16-
require __DIR__.'/settings.php';
17-
require __DIR__.'/auth.php';
9+
require __DIR__ . '/settings.php';
10+
require __DIR__ . '/auth.php';

0 commit comments

Comments
 (0)