0

I get the error above when I am trying to pass a foreign key to main table using a hidden field in the form. This is the line I added: <input type="hidden" value="{{ category_id }}">

I also tried to do: <input type="hidden" value="{{ $assortments->category_id }}"> since category_id is a foreign key of that table. Does anybody know how I can solve this problem?

I already tried looking in the Laravel documentation and I read other StackOverflow questions about this subject but their answers did not help me out.

category_id is a column in the assortments table. I am trying to pass that id. It is not a variable.category_id is a foreign key.

I also wrote it like this: <input type="hidden" value="{{ $category_id }}">

Which gives the following error:

Undefined variable: category_id

Parsa_237
  • 117
  • 1
  • 2
  • 12
  • 2
    you're missing a $ sign in `{{ category_id }}` that's the error, if the variable is defined, it will work, if not, you need to add more details to your question. – N69S Oct 06 '20 at 13:35
  • `category_id` is a column in the `assortments` table. It is not a variable. I want to pass that id in the form – Parsa_237 Oct 06 '20 at 13:37
  • Please check the edit @N69S – Parsa_237 Oct 06 '20 at 13:38
  • 1
    you still need to add more details regarding how you are sending the assortment data to the view/blade – N69S Oct 06 '20 at 13:42

0 Answers0