Reputation: 3670
Is there a way in Laravel5 where I could define routes that handles dynamic routes without conflicting with current static routes? Something similar below:
// Dynamic routes
Route::get('{permalink}', function($permalink) {
//look for matching username on the table (bind perhaps?)
});
// Static routes
Route::get('home', 'HomeController@index');
Route::get('products', 'ProductController@index');
Any ideas, guys? Thanks.
Upvotes: 4
Views: 612
Reputation: 163768
Static and dynamic routes shouldn't conflict with each other. Just put static routes higher than dynamic ones.
Upvotes: 5