定制 owenvoke/blade-fontawesome 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

owenvoke/blade-fontawesome

Composer 安装命令:

composer require owenvoke/blade-fontawesome

包简介

A package to easily make use of Font Awesome in your Laravel Blade views

README 文档

README

Latest Version on Packagist Software License Build Status Static Analysis Total Downloads Buy us a tree

A package to easily make use of Font Awesome in your Laravel Blade views.

For a full list of available icons see the SVG directory.

Documentation for older versions

You are reading the documentation for 3.x which uses Font Awesome 7.

If you're wanting Font Awesome 6, please see the docs for 2.x.

If you're using Laravel 8 or below, please see the docs for 1.x.

Please see the upgrade guide for information on how to upgrade to the latest version.

Requirements

  • PHP 8.3 or higher
  • Laravel 12.x or higher

Install

Via Composer

composer require owenvoke/blade-fontawesome

Configuration

Blade Font Awesome also offers the ability to use features from Blade Icons like default classes, default attributes, etc. If you'd like to configure these, publish the blade-fontawesome.php config file:

php artisan vendor:publish --tag=blade-fontawesome-config

Usage

Icons can be used as self-closing Blade components which will be compiled to SVG icons:

<x-fas-cloud/>

You can also pass classes to your icon components:

<x-fas-cloud class="w-6 h-6 text-gray-500"/>

And even use inline styles:

<x-fas-cloud style="color: #555"/>

Icon Sets

Note: These are default prefixes for the specified icon sets, these can all be configured in the config/blade-fontawesome.php file.

Free Icon Sets

  • Brands (fab)
  • Regular (far)
  • Solid (fas)

Pro Icon Sets

  • Duotone (fad)
  • Light (fal)
  • Thin (fat)
  • Sharp Regular (far:sharp)
  • Sharp Light (fal:sharp)
  • Sharp Solid (fas:sharp)
  • Sharp Thin (fat:sharp)
  • Sharp Duotone (fad:sharp)
  • Custom Kit Icons (fak)

To remove any pro icon sets, set the value to false in the blade-fontawesome config file. For example:

'sharp-regular' => false,

Raw SVG Icons

If you want to use the raw SVG icons as assets, you can publish them using:

php artisan vendor:publish --tag=blade-fontawesome --force

Then use them in your views like:

<img src="{{ asset('vendor/blade-fontawesome/solid/cloud.svg') }}" width="10" height="10"/>

Font Awesome Pro

Blade Font Awesome supports pro icons using npm for downloads.

To use this, install Font Awesome Pro using npm i --save @fortawesome/fontawesome-pro, and then run the following Artisan command to add the icons to your resources path.

php artisan blade-fontawesome:sync-icons --pro

Blade Font Awesome will then automatically detect and use the pro icons under the resources/icons/blade-fontawesome path.

Font Awesome Kits

Blade Font Awesome supports the use of the npm kits via the --kit option.

To use a configured kit, Font Awesome docs installing kits using npm install --save '@awesome.me/kit-KIT_CODE@latest', and then run the following Artisan command to add the icons to your resources path.

php artisan blade-fontawesome:sync-icons --kit=KIT_CODE

Blade Font Awesome will then use the icons from the kit to populate the resources/icons/blade-fontawesome directory.

Caching

Because of the sheer number of icons, a small performance hit can be seen when using pro or kit-supplied icons. If you'd like to mitigate this, you can cache the icons. To do this, run the following Artisan command:

php artisan icons:cache

Blade Icons

Blade Font Awesome uses Blade Icons under the hood. Please refer to the Blade Icons readme for additional functionality.

Change log

Please see GitHub Releases for more information on what has changed recently.

Testing

composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email security@voke.dev instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Treeware

You're free to use this package, but if it makes it to your production environment you are required to buy the world a tree.

It’s now common knowledge that one of the best tools to tackle the climate crisis and keep our temperatures from rising above 1.5C is to plant trees. If you support this package and contribute to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

You can buy trees here.

Read more about Treeware at treeware.earth.

owenvoke/blade-fontawesome 适用场景与选型建议

owenvoke/blade-fontawesome 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.7M 次下载、GitHub Stars 达 209, 最近一次更新时间为 2020 年 06 月 23 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 owenvoke/blade-fontawesome 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 owenvoke/blade-fontawesome 我们能提供哪些服务?
定制开发 / 二次开发

基于 owenvoke/blade-fontawesome 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 3.7M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 210
  • 点击次数: 22
  • 依赖项目数: 47
  • 推荐数: 4

GitHub 信息

  • Stars: 209
  • Watchers: 4
  • Forks: 34
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-06-23