AliTalib
124
16
Laravel

How to foreach this data

Posted 5 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.

Reply to

Use Markdown with GitHub-flavored code blocks.