John Davidson

php - laravel implode maped collection with link (a tag)

0 comments
Message:


i use laravel 8 method for map key and join them with implode
it's work fine but i want joined value with link


my code :


{{$item->artists->map(function ($artist, $key) {
return $artist->title ;
})->implode('meta_value', ' , ')}}

it return somthing like : artist-1 , artist-2


but i want somthing like : <a href="artist-1">artist-1</a> , <a href="artist-2">artist-2</a>


thanks



My Answer:
>map(function($item, $key) {
return '' . $item->name . '';
})->implode(', ')}}

Rate this post

4 of 5 based on 5318 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us