承接 teksite/icon-laravel 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

teksite/icon-laravel

Composer 安装命令:

composer require teksite/icon-laravel

包简介

This package is a simple and tiny SVG icons font laravel

README 文档

README

About

A simple and lightweight SVG icon package for Laravel.

Author

Sina Zangiband

Contact

Step 1: Install via Composer

Run the following command in your terminal:

composer require teksite/icon-laravel

Laravel 5.x and earlier

If you are using Laravel 5.x or earlier, register the service provider in the config/app.php file under the providers array:

'providers' => [
    // Other Service Providers
    Teksite\IconLaravel\IconLaravelServiceProvider::class,
];

Note: This step is not required for newer versions of Laravel (5.x and above).

Usage

Step 2: Create Blade Component

Create a blade component file named icon.blade.php in resources/views/components/ directory.

Add the following content:

<svg x="{{$x}}" y="{{$y}}" width="{{$width}}" height="{{$height}}" viewBox="{{$viewbox}}" {{$attributes->merge(['class'=>'tkicon '.$icon]) }} data-icon="{{$icon}}" stroke-width="{{$strokeWidth}}" stroke-linecap="{{$strokeLinecap}}" stroke-linejoin="{{$strokeLinejoin}}">
   {{ $title && strlen($title) ? "<title>$itlte</title>" : '' }}
    {!! $path !!}
</svg>

Step 3: Use in Blade Template

<x-icon icon="example" class="stroke-red-600 fill-none" />

Custom Icons

You can add your own SVG icons by creating a JSON file at:

storage_path('app/svg-icons/outline.json') --> for outline svg icons storage_path('app/svg-icons/solid.json') --> for solid svg icons

Tip: Only save the path tags inside the JSON file.

Example custom.json:

[ {"name": ""}, {"name": ""} ]

Configuration

You can change the default paths and settings by publishing the config file:

php artisan vendor:publish --provider="Teksite\IconLaravel\IconLaravelServiceProvider"

Then edit config/icon-laravel.php.

Support

Feel free to reach out if you have any questions or need assistance with this package.

统计信息

  • 总下载量: 9
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固