Icons
Suggest EditCustom Icons
In order to include an icon from a popular icon set such as Font Awesome, you can create a new directory for
storing the icons. For example, you can create a new icons directory and a fontawesome subdirectory in your
resources folder:
resources
- css
- icons
-- fontawesome
- js
- lang
- views
Once you have created the new directory, you can download the appropriate icons and place them in the new
directory. For example, you can download the notebook
icon
and place it in the fontawesome subdirectory.
Next, you need to configure the package to search for icons in the new directory. You can do this by editing the
config/platform.php configuration file:
'icons' => [
'fa' => resource_path('icons/fontawesome')
],
In the example above, we have declared the prefix “fa” and the directory where the icons are located.
In order to display the icons in the package’s components, you only need to pass the prefix and the icon’s name. For example, the icon definition in a menu would look like this:
Menu::make('Example of custom icons')
->icon('fa.address-book')
->url(#);
You can also use the icons outside of the admin panel by using the Blade component.