How to foreach this data

Posted 2 months ago by AliTalib

The extraction values are separate and non-duplicated

this my database table https://i.imgur.com/QxnS67l.png

When it is extracted it is like this

https://i.imgur.com/QF1PrIk.png

I want to be like that

https://i.imgur.com/lDbz9sl.png

Please apply to this example

@foreach($genres as $genre)

<a href="{{ url('cinema/movies/genre/'.$genre->genre) }}" class="item">{{ $genre->genre }}</a>

@endforeach 

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

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.