Hi I am new to the laravel framework and I seem to be having some trouble in calling specific methods from controllers.
Here is what I have done so far.
I have configured the route to the controller:
Route::controller('users', 'UserController');
class UserController extends BaseController{
public $restful = true;
public function get_index($id = null)
{
$ceva = new Model();
return Response::json($ceva );
}
public function get_index2()
{
return "something";
}
}
Comming from a background of ASP.NET MVC I expected to call each method like this:
http://localhost:8585/RestPHP/public/users/get_index
http://localhost:8585/RestPHP/public/users/get_index
But this throws a controller method not found exception.
It seems do that in knows how to get the get_index method by itself.
If I call :
http://localhost:8585/RestPHP/public/users/
I get my json repsonse
How can I call each method as I need?