357
Hello to all, welcome to therichpost.com. In this post, I will tell you, Laravel Route with variable. Like I always say that laravel is the best Mvc php framework.
Here is the working route code and you can set variable in laravel routes and use it anywhere:
//web.php code: Route::get('/test/{id?}', function ($id = 1) { return view('test', ['id' => $id]); }); //you can use it like: http://laravel.test/test/1
if you have any query related this post then please do ask.
You Might Also Like
- How to check Email already exists in laravel with ajax?
- How To Create Custom 404 Error View in laravel?
- Laravel custom raw queries example
- Laravel pagination using mysql limit offset
- Implementing SP Admin Dashboard Template in Laravel 10
- Inventory Management System Laravel 10+ Free Download
- Laravel 10 School Admin Dashboard Template Free
- Database Seeding in Laravel 8 With Faker
- Vue Laravel Tutorial Part 6 – Form Submission
- How to Split Laravel Routes into Multiple Files?
- Vue Laravel Image Upload
- How to pass laravel route to controller with multiple parameters?
- How to solve a timeout error in Laravel?
- Laravel 8 Multiple Image Upload Preview Save inside Folder Working Functionality
- How to use carbon in laravel for date time?
- How to show data in Angular 7 datatables with laravel Rest API?
- Vue 3 Laravel 8 AUTH User Registration Working Example
- Laravel 8 Powerful Ecommerce Admin Panel Template Free
- How Session Works In laravel?
- Vue Laravel Tutorial Part 3