When I am requesting all parameters than it is giving me NULL
My Controller store function as:
public function store(Request $request)
{
dd($request->all());
}
My view file as:
@extends('main')
@section('content')
<form class="add_form" id="add_form">
@csrf
<input type="text" name="param_1" >
.
.
.
.
till 1450 parameters
<button type="button" id="submit" >Submit</button>
</form>
@endsection
@push('scripts')
<script type="text/javascript">
$(document).ready(function(){
$("#submit").on("click",function(e){
$.ajax({
type:"POST",
url:"{{ route('froms.store') }}",
data: new FormData($('#add_form')[0]),
processData: false,
contentType:false,
success: function(data){
if(data.status==='success'){
location.reload();
}else if(data.status==='error'){
location.reload();
}
}
});
});
});
</script>
@endsection
Output that I am getting on store function is NULL
Now problem with this is that if I am using parameters less than 1000 than I am getting all request in my controller but when I am using it with more than that not able get request
Apart It is compulsory to have all request at a time not able to do parietal forms also.
I think this issue is related to PHP configuration (php.ini) file Check the
post_max_sizeandmax_input_varsincrease these values if necessary.You can find php.ini file on linux on given path.
Or you can try
JSON.stringify()function while sending ajax request. By using this you can reduce the size of the data being sent in the AJAX requestFor More information read stackoverflow thread.
Tried this scenario on my local environment