Performance: Route naming
MEDIUM IMPACT
Route naming affects server-side routing resolution speed and maintainability, indirectly impacting page load speed by enabling efficient URL generation and caching.
Route::get('/user/profile', function () { /* ... */ })->name('profile'); // Generating URL by route name $url = route('profile');
Route::get('/user/profile', function () { /* ... */ }); // Generating URL by hardcoding path $url = url('/user/profile');
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Hardcoded URLs | 0 (server-side only) | 0 | 0 | [X] Bad |
| Named Routes with caching | 0 (server-side only) | 0 | 0 | [OK] Good |