How to pass data through URL and access through controller in Laravel

0 votes
How can I print my passed argument in url via controller that has created through command promt?
Mar 18, 2020 in Laravel by kartik
• 37,520 points
11,900 views

1 answer to this question.

0 votes

Hello,

You can  first refer how to  Create controller through cmd promt in Laravel.

Then after controller is created you can add simple function to that controller as shown below:

Then go to resource and the web.php and simply add route to that page as follow:

Here {id} will access the passed parameter in url of browser and then it passed this parameter to controller and controller will print the data

answered Mar 18, 2020 by Niroj
• 82,840 points

Related Questions In Laravel

0 votes
1 answer

How to get data from Laravel backend and display in Vue/Nuxt frontend

Hello, You have to use the package dotenv. Then ...READ MORE

answered Apr 8, 2020 in Laravel by Niroj
• 82,840 points
3,228 views
0 votes
1 answer

How to pass data to mail View in laravel Mail send?

Hello @kartik, Send data like this. $data = [ ...READ MORE

answered Jul 30, 2020 in Laravel by Niroj
• 82,840 points
7,898 views
0 votes
1 answer

How to pass data to view in Laravel?

Hello @kartik, You can pass data to the ...READ MORE

answered Sep 11, 2020 in Laravel by Niroj
• 82,840 points
697 views
+1 vote
1 answer

What are named routes in Laravel and How can specify route names for controller actions?

Hey @kartik, Named routing is another amazing feature of ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,840 points
44,678 views
0 votes
1 answer

What is Laravel framework? Why one should use Laravel?

Laravel is a PHP web-framework; it utilized ...READ MORE

answered Mar 17, 2020 in Laravel by Niroj
• 82,840 points
1,680 views
0 votes
1 answer

How to download and install Lavavel framework?

Hey @kartik, First you must have xampp install ...READ MORE

answered Mar 17, 2020 in Laravel by Niroj
• 82,840 points
1,441 views
0 votes
1 answer

How can we get started with Laravel through Xampp?

Hii, First you need to start Apache and ...READ MORE

answered Mar 17, 2020 in Laravel by Niroj
• 82,840 points
1,014 views
0 votes
1 answer

What are the important directories used in a common Laravel application

Hey @Kartik. Directories used in a common Laravel ...READ MORE

answered Mar 17, 2020 in Laravel by Niroj
• 82,840 points
2,416 views
0 votes
1 answer

How to pass URL param in Laravel?

Hello, First you have to go to routes ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,840 points
5,188 views
0 votes
1 answer

Explain validations in laravel and How to validate my application incoming data?

Hey @kartik, In Programming validations are a handy ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,840 points
1,430 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP