samedi 2 décembre 2017

Laravel submitting form from controller?

I wanted to post a form to a webstie and update the database at the same time.. with one submit button

form.blade.php

<form action="" method="post">
  <input type="text" name="user_id" value="">
  <input type="text" name="item_name" value="">
  <input type="text" name="first_name">

  <input type="submit" value="Submit">
</form>

formController.php

public function post(Request $req){
 //$req = user_id=1&item_name=ball&first_name=tera

 //i want to post to link a
 (post $req to link a);

 //and then updates database..
 updateusers($req,);

}

is there a way to use the controller and using php only (so i can add validation later down the line if needed) or is there another way around it??



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2iA3SuZ
via IFTTT

Aucun commentaire:

Enregistrer un commentaire