JayGreentree's avatar

Help with dropdown

I'm still learning Laravel so I need a bit of help. I have a list of projects in a sidebar nav template that I want to be a dropdown link after x items. website uses Tailwind css with flowbite js. Any help would be appreciated. The code below is what I have so far.

0 likes
4 replies
Tray2's avatar

You mean that you want something like this?

  • Link
  • Link
  • Link
  • Link
  • Link
  • Dropdown with the rest of the links
Tray2's avatar
Tray2
Best Answer
Level 73

So something like

@if(count($links) <= 5)
   @foreach($links as $link)
     <a href="{{ $link->url }}">{{ $link->text }}</a>
   @endforeach		
@else
    <select>
		@foreach($links as $link)
          <option value="{{ $link->url }}">{{ $link->text }}</option>
        @endforeach				
    </select>
@endif
1 like

Please or to participate in this conversation.