Skip to main content

Posts

Showing posts with the label resource route in laravel 8

Laravel 8 Resource Routing Example

Hi Dev, Today,I will explicate you how to engender resource route in laravel 8. we will show laravel 8 resource routing example.laravel resource routing assigns the typical "crud" routes to a controller with a single line of code. for example, you may wish to engender a controller that handles all http requests for "posts" stored by your application. utilizing the composition:controller artisan command, you can expeditiously engender such a controller. You have to engender resource route on laravel they provide insert, update, view, efface routes and second you have to engender resource controller that will provide method for insert, update, view and efface. Here ,I will engender a controller at app/Http/Controllers/PostController.php. The controller will contain a method for each of the available resource operations. So, in this example we will visually perceive how to engender resource route and how they work. we have to understand why we choose resource route