In L5 you have to use
Request::all();
http://laravel.com/docs/5.0/requests
Edit: actually, they might be the same :)) try with Request::all() though, if it does not work we'll figure out something else
Unfortunately, the output was the same:
{"_token":"PWKknjx5S9u8m98ApGDXYKqaTyF7aFZDaye9uYPm","hotel_name":"City Loft","hotel_website":"http://www.cityloft.com.tr/","facilities":"23","country":"6","region":"3344950","city":"783593","country_code":"+355","phone":"(123) 123-1231","extension":"3123","status":"1","publisher":"1"}
Are you sure you are sending all the values to the controller? Which inputs are missing?
How can I determine which fields are going to be send into the controller, if I'm using normal submit posting request ?
and in Ajax its not working for me I don't know why.
this is my ajax code:
// Ajax post requests
var submitAjaxRequest = function(e){
e.preventDefault();
var form = $(this);
if( $(form).valid()) {
$('#loader').show();
$(":submit").attr("disabled", true);
}
var method = form.find('input[name="_method"]').val() || "POST";
var _token = $( '#myToken').attr('value');
var hotel_name = $( '#hotel_name' ).val();
var hotel_details = $( '#hotel_details' ).val();
var hotel_website = $( '#hotel_website' ).val();
var rank = $( '#rank' ).val();
var single_price = $( '#single_price' ).val();
var double_price = $( '#double_price' ).val();
var extra_bed_price = $( '#extra_bed_price' ).val();
var facilities = $( '#facilities' ).val();
var city_id = $( '#city' ).val();
//if( $(form).valid()){
$.ajax({
type: method,
url: form.prop('action'),
//data: form.serialize(), // like Eloquent NOT ALL inputs
data: {
_token: _token,
name: hotel_name,
details: hotel_details,
website: hotel_website,
rank: rank,
single_price: single_price,
double_price: single_price,
extra_bed_price:extra_bed_price,
facilities: facilities,
city_id: city_id
},
success : function ()
{
$('#loader').hide();
$(":submit").attr("disabled", false);
}
});
//}
return false;
};
$( 'form[data-remote]' ).on( 'submit',submitAjaxRequest );
and for the other codes kindely, see this link https://stackoverflow.com/questions/28874134/form-submit-inputall-not-showing-all-inputs
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community