Support the ongoing development of Laravel.io →
Requests Input Forms
Last updated 1 year ago.
0

What version of laravel are u using?

0

Laravel 5

0

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

Last updated 9 years ago.
0

Unfortunately, the output was the same:

{"_token":"PWKknjx5S9u8m98ApGDXYKqaTyF7aFZDaye9uYPm","hotel_name":"City Loft","hotel_website":"http://www.cityloft.com.tr/","facilities":"...;(123) 123-1231","extension":"3123","status":"1","publisher":"1"}

0

Are you sure you are sending all the values to the controller? Which inputs are missing?

Last updated 9 years ago.
0

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-input...

Last updated 9 years ago.
0
Solution

Thanks a lot I got the solution in Stackoverflow

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.