Download the PHP package avvertix/materialicons-laravel-bridge without Composer
On this page you can find all versions of the php package avvertix/materialicons-laravel-bridge. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download avvertix/materialicons-laravel-bridge
More information about avvertix/materialicons-laravel-bridge
Files in avvertix/materialicons-laravel-bridge
Package materialicons-laravel-bridge
Short Description Material Design Icons packaged for easy SVG inlining in Laravel Blade templates
License Apache-2.0
Informations about the package materialicons-laravel-bridge
[!IMPORTANT] Material Icons Laravel Bridge has been deprecated with 2.1.0 as the last release. There are a number of alternatives based on Blade Icons (Blade UI Kit). Thank you for the support and contributions over the years. The repository will remain open and archived.
Material Icons Laravel Bridge
Easily use Google Material Design SVG icons in Laravel Blade templates.
For a full list of available icons see the SVG directories.
Requirements
- PHP 7.2 or higher
- Laravel 7.14 or higher
blade-ui-kit/blade-icons
Using version
1.x
? Check the upgrade guide.
Installation
You can install this package via Composer by running this command in your terminal in the root of your project:
The service provider
MaterialIcons\MaterialIconsBridgeServiceProvider::class
is automatically registered as part of the Laravel service discovery
Configuration
By default the class icon
is added to the svg
tag when inserted into a page.
You can change this behavior by overriding the configuration using
the config/materialiconset.php
file.
A ready to use configuration file can be inserted in your config directory using
php artisan vendor:publish --provider="MaterialIcons\MaterialIconsBridgeServiceProvider"
You can specify any default CSS classes you'd like to be applied to your icons using the class
option:
You can specify multiple classes by separating them with a space, just like you would in an HTML class attribute.
Usage
Blade directive
To insert an icon in your template use the @materialicon
directive, passing the name of
the material icon set, the name of the icon and optionally any additional classes:
To add additional attributes to the rendered SVG tag, pass an associative array as the third parameter:
If you'd like, you can use the materialicon
helper directly. The helper exposes a fluent syntax for setting icon
attributes:
Blade components
All icons are available as Blade components, thanks to Blade Icons
The component name format is: package name
materialicon
, the set within the packagetoggle
and the file nameic_star_half_24px
.
You can also pass classes to your icon components:
Or any other attributes for that matter:
Helper
If you'd like, you can use the materialicon
helper to expose a fluent syntax for setting SVG attributes:
Use another icon set
Even if this package makes easy to use Google's Material Design icons, it is not limited to that iconset.
You can still use a different iconset as behind the scenes the blade-ui-kit/blade-icons
package is used.
Please check Blade Icon's documentation for all the configuration options and how to insert icons within your Blade views.
Upgrade
Upgrading from an older version? Check the upgrade guide.
Credits
- The icons comes from the Google Material Design Icons package;
- The package functionality was originally created on top of the great Blade SVG package by Adam Wathan now
handed to Dries Vints as
blade-ui-kit/blade-icons
.
All versions of materialicons-laravel-bridge with dependencies
blade-ui-kit/blade-icons Version ^0.4|^0.5
illuminate/support Version ^7.14|8.*
illuminate/filesystem Version ^7.14|8.*