Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

convert form data request to json laravel

$collect = []; // empty array for collect customised inputs

foreach($request->all() as $input_key => $input_value){ // split input one by one

     $collect[] = array( //customised inputs
            "id" => $input_key,
            "value" => $input_value

     );
} 

$result = json_encode($collect); //convert to json
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #form #data #request #json #laravel
ADD COMMENT
Topic
Name
2+2 =