Reputation: 656
In a restful controller, which class should I use to get passed variables?
$member->email = Input::get('email');
// or
$member->email = Request::get('email');
both options work for me, but whats the difference?
Upvotes: 6
Views: 3938
Reputation: 1143
Input::get()
is just a helper that maps to the Request class. It doesn't really matter which you use.
Upvotes: 11
Reputation: 752
With Laravel 3 i prefer to use:
$member->email = Input::get('email');
But with Laravel 4 I prefer to use:
$member->email = Request::get('email');
Please check the article:
http://net.tutsplus.com/tutorials/php/laravel-4-a-start-at-a-restful-api/
Upvotes: 0
Reputation: 2141
I believe that Request is preferred in the context of a restful controller.
Upvotes: 0