承接 secondnetwork/blade-google-material-symbols 相关项目开发

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

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

secondnetwork/blade-google-material-symbols

最新稳定版本:v0.0.3

Composer 安装命令:

composer require secondnetwork/blade-google-material-symbols

包简介

A package to easily make use of blade-google-material-symbols in your Laravel Blade views.

README 文档

README

Latest Stable Version PHP 8.2 License

A Blade icon pack for the Google Material Symbols set, designed for easy use in Laravel projects. This package is built on top of the excellent blade-ui-kit/blade-icons package.

This package provides three primary icon styles: Outlined, Rounded, and Sharp. The Filled style is cleverly integrated by appending a -fill suffix to any icon name.

⚠️ Important Notice

Please note: In the current version, the icons are only accessible via the @svg() directive (or the {{ svg() }} helper) provided by blade-ui-kit/blade-icons. The previous component syntax (e.g., <x-gmso-home />) is not functional at this time. We are actively working to restore this functionality in a future update.

Requirements

  • PHP 8.1+
  • Laravel 9.0+
  • blade-ui-kit/blade-icons (will be installed automatically)

Installation

You can install the package via composer:

composer require secondnetwork/blade-google-material-symbols

The package will automatically register itself.

Usage

Use the @svg() or {{ svg() }} directive to render an icon. The icons are identified by a prefix corresponding to their style.

Style Prefix Example (Outlined) Example (Filled)
Outlined gmso @svg('gmso-home') @svg('gmso-home-fill')
Rounded gmsr @svg('gmsr-home') @svg('gmsr-home-fill')
Sharp gmss @svg('gmss-home') @svg('gmss-home-fill')

How the "Filled" Style Works

Instead of providing a separate set for filled icons, you can get the filled version of any icon in any set by simply appending the -fill suffix to the icon's name.

Outlined Example:

{{-- Renders the outlined home icon --}}
@svg('gmso-home')

{{-- Renders the filled home icon --}}
@svg('gmso-home-fill')

Rounded Example:

{{-- Renders the rounded settings icon --}}
@svg('gmsr-settings')

{{-- Renders the filled rounded settings icon --}}
@svg('gmsr-settings-fill')

Styling

You can easily style the icons by passing an array of attributes like class, width, and height as the second parameter to the directive.

{{-- Using Tailwind CSS classes for size and color --}}
@svg('gmso-check-circle', ['class' => 'size-8 text-green-500'])

{{-- Setting explicit width and height --}}
@svg('gmsr-delete-fill', ['class' => 'text-red-600', 'width' => '24', 'height' => '24'])

Configuration

If you wish to customize the component prefixes, you can publish the configuration file:

php artisan vendor:publish --provider="secondnetwork\MaterialSymbols\BladeMaterialSymbolsServiceProvider"

This will create a config/blade-google-material-symbols.php file in your project. You can modify the prefixes for each set as needed.

// config/blade-google-material-symbols.php

return [
    'sets' => [
        'material-outlined' => [
            'path' => __DIR__.'/../resources/svg/material-outlined',
            'prefix' => 'gmso',
        ],
        'material-rounded' => [
            'path' => __DIR__.'/../resources/svg/material-rounded',
            'prefix' => 'gmsr',
        ],
        'material-sharp' => [
            'path' => __DIR__.'/../resources/svg/material-sharp',
            'prefix' => 'gmss',
        ],
    ],

    // You can also define a default class that will be applied to all icons.
    'default_class' => 'inline-block',
];

Maintainers

blade-google-material-symbols is developed and maintained by secondnetwork.

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-25