vendredi 1 mars 2019

How use the FontAwesome icon in Laravel array_map & link_to_route fucntions

I have this piece of code which displays tags assigned to my Entity model.

    {!!
        join(', ',
        array_map(function($o) {
        return link_to_route('entities.summary',
        $o->name,
        [$o->id],
        ['class' => 'btn btn-primary btn-sm']
        );},
        $o->tags->all())
        ) 
    !!}

problem

I want to add FontAwesome icon. I have no clue. Any ideas? One solution is to dro the code and do a foreach loop, but I prefer to stick to the existing one.

Thank you



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire