F
F
Fireproof Cockroach2019-09-13 15:13:21
Laravel
Fireproof Cockroach, 2019-09-13 15:13:21

How to make the route:list command display the path to the action and not the Closure?

Hello. Laravel has a way to write routes like this:

Route::name('domains')->get('domains', [DashboardController::class, 'domains']);

(Here , here and here they wrote)
This is convenient and useful for the IDE and more visually.
But such routes are displayed in the command php artisan route:listwhere is the path to the Closure controller.
In the neighboring project, it is displayed normally, nothing was done specifically for this. Who knows what could be the reason? Where to dig?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
JhaoDa, 2019-09-13
@uonick

Route::name('domains')->get('domains', [DashboardController::class, 'domains']);
// Closure

Route::get('domains', [DashboardController::class, 'domains'])->name('domains');
// '[email protected]'

Magic.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question