Skip to content
virtualstep edited this page May 1, 2015 · 6 revisions

Chances are you will be attributing a font icon to your menu items frequently. With that in mind, Caffeinated Menus provides the means to easily do this to save you from having to type out long messy HTML for every icon you need.

At the moment, Caffeinated Menus supports both Font Awesome (default) and Glyphicon.

...

// FontAwesome
$menu->add('Users', 'admin/users')
    ->icon('users');

// Glyphicon
$menu->add('Users', 'admin/users')
    ->icon('users', 'glyphicon');

...

Once this is done, you can access your icon in a few different ways.

Prepending the icon to your item's title:

{!! $item->prependIcon()->title !!}

Appending the icon to your item's title:

{!! $item->appendIcon()->title !!}

Calling the icon only:

{!! $item->icon !!}
Clone this wiki locally