[$request->get('name')], [$request->input('name')] or [$request->name] ?

Posted 3 years ago by giovanniciriello

Hi. The three solution perfectly works. But the documentation is not totally clear about. Which are the differences and what's the best way to get a variable from request?

public function(Request $request){

    $request->get('name');  //Josh
    $request->input('name'); //Josh
    $request->name; //Josh

}

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.