Form doesn't get values

Posted 5 months ago by Shoken

Here's my form:

<form id="filter" action="/filter" method="POST">
        @csrf
               <h6>Categorie</h6>
              <div class="checkbox checkbox-primary">
                <ul>
                  @foreach($data['category'] as $category)
                  <li>
                    <input form="filter" id="cat-{{$category->id}}" value="{{$category->id}}" class="styled" type="checkbox" >
                    <label for="cat-{{$category->id}}"> {{$category->name}} </label>
                  </li>
                 @endforeach
                </ul>
              </div>
              
              <!-- Featured Brands -->
              <h6>Brand in vetrina</h6>
              <div class="checkbox checkbox-primary">
                <ul>
                  @foreach($data['brands'] as $brand)
                  <li>
                    <input form="filter" id="brand-{{$brand->id}}" value="{{$brand->id}}" class="styled" type="checkbox" >
                    <label for="brand-{{$brand->id}}"> {{$brand->name}} </label>
                  </li>
                  @endforeach
                    <input type="submit" form="filter" value="Filter" class="btn-round">
                </ul>
              </div>

      </form>

It seems fine to me, however when I dd($request) from the controller, there's nothing in the parameter bag. The form appears just fine, so I have no clue what is going wrong. The checkboxes can be selected but no value is taken, apparently.

My routes are set up correctly and my controller only contains a dd($request)

Please sign in or create an account to participate in this conversation.