skip to Main Content

ID input

<input class="form-control" type="hidden" value="{{ Auth()->user()->id }}">

After dump

"_token" => "BP0ejzEjoIjFyUonjdMFNAyoRDcYCr4k7nec5czI"
      "name" => "Mark"
      "surname" => "Johanessburg"
      "number" => "8281992832"
      "email" => "[email protected]"

So I’m trying to send the user’s ID through the form. But when I clicked the submit button and do a dd, there is no ID sent. What can I do to fix this or is there something I did wrong? Thank you in advance.

2

Answers


  1. <input class="form-control" name="id" type="hidden" value="{{ Auth()->user()->id }}">
    

    parameter fo id was missing

    Login or Signup to reply.
  2. U need to add name attribute to the input field to get it in the submitted data

    <input class="form-control" name="id" type="hidden" value="{{ Auth()->user()->id }}">
    

    The name attribute is used by the request object to get the form field data…

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search