Download the PHP package blinq/icons without Composer
On this page you can find all versions of the php package blinq/icons. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package icons
Short Description Super simple embedding of icons sets in you Laravel application.
License MIT
Homepage https://github.com/blinq/icons
Informations about the package icons
Laravel blade icons
One-click icons for Laravel
This package makes it super simple to embed svg icons in your laravel project. No need to download entire icon sets that will bloat your code. It only grabs the icons you want and caches them locally 🚀
Available at the time or writing:
- Heroicons (mini / outline / solid)
- Font awesome (brands / regular / solid)
- Material icons (default / outlined / round / sharp / twotone)
Go see https://icons.blinq.dev
Installation
Simply conjure up the following in your terminal:
`
Usage
Go to https://icons.blinq.dev and find the icon you want.
That's it! First time around, it'll download the icon to your resources folder, and from then on, it'll load from there.
Configuration
Optionally, you can publish the config file using:
This is the contents of the published config file:
Optionally, you can publish the views using
Add another icon pack & contribute
Would you like to add another icon pack? Let's use Heroicons as an example.
You can find the "academic-cap" icon here:
https://raw.githubusercontent.com/tailwindlabs/heroicons/master/src/24/outline/academic-cap.svg
Thus, the download base path is:
https://raw.githubusercontent.com/tailwindlabs/heroicons/master/src
If you want to obtain a list of all files available in this GitHub repository, you can use the following URL:
https://api.github.com/repos/tailwindlabs/heroicons/git/trees/master?recursive=1
We must then transform this list into a format that blinq/icons
understands. This transformation is described in a discovery.json
file, which is created automatically.
To achieve this, we need to write some code that will transform the GitHub trees response into a discovery.json
file. Take a class at the beforeDiscoveryFileCreated
method below.
In this case, we also need to make adjustments to the SVG contents so they work well with the classes we apply to them. You can find guidance in the beforeSvgFileCreated
method:
- Remove all specified width and height, as these should be configurable by the user of the icon.
- Similarly, remove all specified colors.
- Set the fill or stroke to currentColor, allowing the user to specify it.
These operations can be consolidated into a single class that extends IconPack
:
Then register this class in a service provider:
You are encouraged to create a pull request with the IconPack class, so i can add this to this repo.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.