How can we use controller once it was created successfully

0 votes
How can i make use of controller which i had created?? can anyone explain me with an example?
Mar 18, 2020 in Laravel by kartik
• 37,520 points
737 views

1 answer to this question.

0 votes

Hey kartik

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:

Here we are printing 100 user via a controller.

so  now we have to set route for controller in order to do this go to routes and the web.php and then form a route method for the controller as shown below:

Here first parameter is the routing name and second parameter is the page name i.e Users.php and index is the function name of users/php page

 thank you!!

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

Related Questions In Laravel

0 votes
1 answer

What is middleware? How can we register middeleware in Laravel?

Middleware acts as a bridge between a ...READ MORE

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

How can we Disable CSRF Laravel?

Hello, You can disable CSRF Laravel from the App/Http/Kernel.php file ...READ MORE

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

How can we generate migration in Laravel?

Hello, Migrations are like version control for your database, ...READ MORE

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

How can we create a record in Laravel using eloquent?

We need to create a new model ...READ MORE

answered Mar 20, 2020 in Laravel by Niroj
• 82,840 points
1,211 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,682 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,443 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,419 views
0 votes
1 answer

How to make a new page with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

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

How can we use the custom table in Laravel?

Hey, We can easily use custom table in ...READ MORE

answered Mar 20, 2020 in Laravel by Niroj
• 82,840 points
2,484 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,018 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