How to get POST request variables in laravel


Take a look at the $_GET and $_REQUEST superglobals. Something like the following would work for your example:

$start = $_GET['start'];
$limit = $_GET['limit'];


1. This is one way to get the POST request variables

use class on your controller method



 The incoming request instance will automatically be injected by the service container:



 use Illuminate\Http\Request; 



$start = $request->input('start');
$limit = $request->input('limit');

see also : https://laravel.com/docs/5.5/requests#accessing-the-request

2. The another way to get the POST request variables

you need to use Input::get(), e.g.,

use class on your controller method 



 use Illuminate\Support\Facades\Input;

$start = Input::get('start');
$limit = Input::get('limit');








 

Comments

Popular posts from this blog

Why Mark Zuckerberg’s Choose 4

Error message when I run sudo: unable to resolve host (none)

Convert MBR to GPT