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
Cache Static Files With NGINX Server
Debugging Laravel Queue Email Issues
Supervisor For Laravel Queue Scheduling
Accessors And Mutators In PHP Laravel
Custom Validation Rules In PHP Laravel (Using Artisan Command)
Install NGINX In Linux / Ubuntu And Managing
SQLite Doesn't Support Dropping Foreign Keys in Laravel
Manipulate HTML Using DOMDocument In PHP
Why namespace And use Keywords Used In PHP
Create A Composer Package? Test It Locally And Add To Packagist Repository
PHP file_put_contents failed to open stream: Permission denied
Search Engine Optimization Concepts
What Is HTTP? Different HTTP Methods And Status Codes Explained With Examples