Resource Controllers2:22 with Jonathan Barrios
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.
You need to sign up for Treehouse in order to download course files.Sign up