Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get All input of POST in Laravel

I am using Laravel 5 and trying to get all input of POST variable in controller like this-

public function add_question() {     return Request::all(); } 

So, I am getting this errors-

enter image description here

What I am doing wrong?

like image 447
Abrar Jahin Avatar asked Sep 22 '15 13:09

Abrar Jahin


People also ask

How can you retrieve the full URL for the incoming request laravel?

The “path” method is used to retrieve the requested URI. The is method is used to retrieve the requested URI which matches the particular pattern specified in the argument of the method. To get the full URL, we can use the url method.

What is request () in laravel?

Laravel's Illuminate\Http\Request class provides an object-oriented way to interact with the current HTTP request being handled by your application as well as retrieve the input, cookies, and files that were submitted with the request.


1 Answers

Try this :

use Illuminate\Support\Facades\Request; public function add_question(Request $request) {     return $request->all(); } 
like image 147
Md Rashedul Hoque Bhuiyan Avatar answered Oct 14 '22 00:10

Md Rashedul Hoque Bhuiyan