Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Laravel Basics!
You have completed Laravel Basics!
Welcome back! In this section, we’ll cover the differences between controllers and resource controllers used for CRUD operations. While this course doesn’t go into a full explanation of CRUD functionality, it’s crucial to understand how both work and, more importantly, how and when to use them. Laravel assigns common "CRUD" routes to resource controllers with a single line of code. For example, if you want to create a controller that handles all HTTP requests for "courses" stored by your application. As I mentioned earlier, you can use the Artisan command: php artisan make:controller -r, to make a resource controller with CRUD built-in. The optional -r flag is the only difference between the two Artisan commands for controllers and resource controllers.
LINKS:
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up