KACKbIP
4 months ago
242
3
Laravel

Hi. Is it possible to get variable names which were generated dynamically?

Posted 4 months ago by KACKbIP

For example

    @foreach($specification as $spec)

       <div class="body bx-filter-container-modef">
        <fieldset class="checkbox">
              <input type="checkbox" name="{{ $sp->name }}_{{ $sp->id }}" value="{{ $sp->value }}" id="{{ $sp->name }}_{{ $sp->id }}" class="show-for-sr"   data-tip-top="-5">
             <label data-role="label_{{ $sp->name }}_{{ $sp->id }}" for="{{ $sp->name }}_{{ $sp->id }}" class="bx-filter-param-label">{{ $sp->value }}</label>
          </fieldset>
   </div>

   @endforeach

My controller

 public function getSpecification(Request $request)
    {
        dd($request);
    }

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