It might be clearer to move your Routing logic into the AdminController
and use a RESTful controller:
in routes.php
add this, and remove the two route definitions for /admin/index
and /admin/test
:
Route::controller('admin' , 'AdminController');
This directs all requests to admin/
to your AdminController. now you need to rename your functions to include the HTTP verb (GET, POST or any), and the next component of your route:
public function getIndex() // for GET requests to admin/index
{
//blha blah blah
}
public function getTest() // for GET requests to admin/test
{
//blha blah blah
}
Finally, update your form to use that route directly through the action
keyword:
{{ Form::open(array('action' => 'AdminController@getTest', 'method' => 'get')) }}
note, using missingMethod()
to catch unhandled requests is really useful too, more info in the Laravel docs: http://laravel.com/docs/controllers#handling-missing-methods
Hope that helps