![Theme Switcher Image](https://stackcoder.in/images/theme-switcher.png?cb=stackcoder90070)
Good content takes time and effort to come up with.
Please consider supporting us by just disabling your AD BLOCKER and reloading this page again.
I was working on the project and had almost completed it, by then all the sudden my manager told to change the URL prefixes of a few modules of the project. I was searching for routes and replacing them manually. It was a pain in the ass to go and change in all the places.
Then I came across Laravel Named Routes and how it saved me and will save me in future from this kind of situation too.
Named routes allow you to generate URLs without being coupled to the actual URL defined on the route.
Route::get('/auth/login', [AuthController::class, 'login']);
Route::get('/auth/login', [AuthController::class, 'login'])->name('login');
Instead of
{{ url('/auth/login') }}
{{ route('/auth/login') }}
Route::post('/payments/payment-success/{event}', [PaymentController::class, 'store']);
Route::post('/payments/payment-success/{event}', [PaymentController::class, 'store'])->name('payment-success');
{{ url('payments/payment-success/' . $event->id) }}
{{ route('payments/payment-success', ['event' => $event->id]) }}
Route::get('/post/{post}/comment/{comment}', [PostController::class, 'show'])->name('comment.show');
{{ route('comment.show', ['post' => 1, 'comment' => 3]) }}
// http://example.com/post/1/comment/3
route('post.show', ['post' => 1, 'search' => 'rocket']);
// http://example.com/post/1?search=rocket
Add Analytics To AMP (Accelerated Mobile Pages) HTML Pages
Google reCAPTCHA Integration In PHP Laravel Forms
Securely SSH Your Server & Push Files With FileZilla
Free SSL Certificate In cPanel With ZeroSSL & Certbot
Move Uploaded Files From Local Computer Or Server To Amazon S3 Bucket In PHP
Run Raw Queries Securely In Laravel
Upload File From Frontend Server {GuzzleHttp} To REST API Server In PHP {Laravel}
Laravel Clear Cache Of Route, View, Config Command
GitHub Login With PHP Laravel Socialite
Generate Fake Data In PHP With Faker
Multiple File Uploads In Laravel PHP
Comment And Like System Using Disqus
Create Gmail App Password For SMTP Mails
PHP Built-In Web Server & Testing Your Development Project In Mobile Without Any Software