Laracasts Avoid Implicit Routing

Avoid Implicit Routing

Avoid Implicit Routing

درباره این درس

If you come from the CodeIgniter world, then you may have warm and fuzzy feelings for implicit routing. You know, where the URI matches up to the controller method that will be called. You might even want this for your Laravel development (which Laravel can do). Though it might seem useful at first to simply call Route::controller('admin', 'AdminController') and then declare all of your desired routes from the controller, there are a number of setbacks to this. In this video, we'll predominantly focus on the "routes files as documentation" aspect, however, there are certainly other reasons. Think about how you would, when using implicit routing, leverage named routes, or create nested resources, or even do something as simple as rename your controller class without affecting your URI design. No, when it comes to implicit routing, just say no.
دیدگاه های کاربران

× در حال پاسخ به: