Laravel Routes: Use ::controllers and ::post

664 Views Asked by At

Within Laravel, I currently have:

Route::controllers([
    'bla' => 'BlaController',
]);

But for a few specific methods within BlaController, I would like to pass parameters via the route (eg: /bla/parameter) and then be able to access that parameter within the controller.

However, declaring:

Route::get('bla/{parameter}', 'BlaController@exampleMethod');

keeps giving me a 404 not found when visiting it.

Is there some kind of conflict between using both declarations within routes.php and if so, is there a way to pass parameters to the controller for specific methods?

Edit: This is Laravel 5.1, if that makes any difference!

1

There are 1 best solutions below

4
On

Can u try this ?

   Route::get('/bla/{parameter}' ['uses'=>'BlaController@exampleMethod']);

http://laravel.io/forum/07-26-2014-routing-passing-parameters-to-controller