I can serve the page using inertia
like this:
Route::inertia('/home', 'home');
To load a page containing database data I have to do this:
Route::get('/terms', [LegalPageController::class, 'index']);
In controller:
class LegalPageController extends Controller { public function index() { $record = Terms::first(); return inertia('terms', compact('record')); } }
Is there any way to shorten it to:
Route::inertia('/home', 'home', [Controller::class, 'index']);
You can’t do this
Use this method instead