Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

tjsherrill's avatar

Laravel post request only receiving 91 rows

I have a pretty straightforward request that submits an array of items. The array in this specific case is 146 items. When I submit and dd(} the request there is only 91 items.

I have tested by dumping the request in the only listed middleware, and its still only 91 items.

Whats even stranger is that the 91st item is missing its last key/value. If I mess with the underlying naming, and data, nothing changes, still just 91 items. :FACEPALM.

0 likes
3 replies
LaryAI's avatar
Level 58

It sounds like you're encountering an issue with the maximum input variables limit in PHP. By default, PHP has a limit on the number of input variables it can process for a single request, which is controlled by the max_input_vars directive in the php.ini configuration file. The default value is usually set to 1000, but in some cases, it might be set lower.

To resolve this issue, you can increase the max_input_vars value in your php.ini file. Here’s how you can do it:

  1. Locate your php.ini file. The location of this file can vary depending on your server setup. Common locations include /etc/php/7.x/apache2/php.ini for Apache on Linux, or C:\xampp\php\php.ini for XAMPP on Windows.

  2. Open the php.ini file in a text editor.

  3. Find the line that sets max_input_vars. It might look something like this:

    max_input_vars = 1000
    
  4. Increase the value to a higher number, such as 2000 or 3000:

    max_input_vars = 3000
    
  5. Save the php.ini file and restart your web server to apply the changes. For Apache, you can typically restart it with:

    sudo service apache2 restart
    

    For Nginx, you might use:

    sudo service nginx restart
    

After increasing the max_input_vars value and restarting your server, try submitting your form again. You should now be able to receive all 146 items in your request.

Here’s a quick summary in code format:

; Open your php.ini file and find the following line
max_input_vars = 1000

; Increase the value to a higher number
max_input_vars = 3000

; Save the file and restart your web server

If you are using a shared hosting environment and do not have access to the php.ini file, you might be able to set this directive in an .htaccess file or a custom php.ini file in your project directory, depending on your hosting provider's configuration.

For .htaccess:

php_value max_input_vars 3000

For a custom php.ini in your project directory:

max_input_vars = 3000

I hope this helps! If you continue to experience issues, please provide more details about your server environment and configuration.

MohamedTammam's avatar

Might be that you're sending too much data, then you can look into Lary answer.

Or, you have items with the same key, in such case only one will be considered.

tjsherrill's avatar

Thanks Lary and @mohamedtammam - The issue was the size of the post. In this case instead of updating the value on max_input_vars, I instead updated the post to json_encode so that it was just a long string. That worked well.

Please or to participate in this conversation.