定制 monsefeledrisse/laravel-solar-icons 二次开发

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

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

monsefeledrisse/laravel-solar-icons

Composer 安装命令:

composer require monsefeledrisse/laravel-solar-icons

包简介

Solar Icon Set for Laravel - Professional icon package with 7,000+ Solar icons across 6 styles

README 文档

README

A comprehensive Solar Icon Set package for Laravel applications, providing 6 different icon styles with over 1,000 high-quality SVG icons. Built on top of the robust BladeUI Icons package.

Features

  • 🎨 6 Icon Styles: Bold, Bold Duotone, Broken, Line Duotone, Linear, and Outline
  • 📦 1000+ Icons: Comprehensive collection covering all major categories
  • 🔧 Laravel Integration: Seamless integration with Laravel applications
  • ⚡ BladeUI Icons: Built on top of the robust BladeUI Icons package
  • 🔒 Type Safety: Enum-based icon system with IDE autocompletion
  • 🎛️ Flexible Usage: Works with Blade components, helper functions, and direct SVG usage
  • ⚙️ Configurable: Customizable icon sets, classes, and attributes
  • 🔍 Developer Tools: Icon browser, search, and helper utilities

Installation

Install the package via Composer:

composer require monsefeledrisse/laravel-solar-icons

The service provider will be automatically registered via Laravel's package discovery.

Quick Start

Using Blade Components

<!-- Solar Bold Icons -->
<x-solar-bold-home />
<x-solar-bold-user />

<!-- Solar Linear Icons -->
<x-solar-linear-settings />
<x-solar-linear-search />

<!-- Solar Outline Icons -->
<x-solar-outline-calendar />
<x-solar-outline-bell />

<!-- With custom attributes -->
<x-solar-linear-home class="w-6 h-6 text-blue-500" />

Using the Icon Helper

<!-- Using the @svg directive -->
@svg('solar-linear-home', 'w-6 h-6')
@svg('solar-bold-user', ['class' => 'text-gray-500'])

<!-- Using the icon component -->
<x-icon name="solar-outline-settings" class="w-5 h-5" />

Using the SolarIcon Enum (Type-Safe)

use Monsefeledrisse\LaravelSolarIcons\SolarIcon;

// In your Blade views
<x-icon :name="SolarIcon::Home->value" />

// In your PHP code
$iconName = SolarIcon::User->value; // Returns 'solar-bold-User'

// Get available sets for an icon
$sets = SolarIcon::Home->getAvailableSets();

// Get icon for specific set
$linearHome = SolarIcon::Home->forSet('solar-linear');

Configuration

Publish the configuration file to customize the package:

php artisan vendor:publish --tag=solar-icons-config

Configure in config/solar-icons.php:

return [
    // Default CSS class for all icons
    'class' => '',

    // Default attributes for all icons
    'attributes' => [
        // 'width' => 24,
        // 'height' => 24,
    ],

    // Icon sets to register (remove unused sets for better performance)
    'sets' => [
        'solar-bold',
        'solar-bold-duotone',
        'solar-broken',
        'solar-line-duotone',
        'solar-linear',
        'solar-outline',
    ],
];

Available Icon Sets

  • solar-bold - Bold style icons (strong visual weight)
  • solar-bold-duotone - Bold duotone style icons (two-tone bold)
  • solar-broken - Broken style icons (stylized broken lines)
  • solar-line-duotone - Line duotone style icons (two-tone lines)
  • solar-linear - Linear style icons (clean, minimal)
  • solar-outline - Outline style icons (clean outlined)

Icon Categories

The Solar icon set includes icons from the following categories:

  • Arrows & Navigation
  • Astronomy & Science
  • Building & Infrastructure
  • Business & Statistics
  • Communication & Call
  • Design & Tools
  • Electronic Devices
  • Essential UI Elements
  • Faces & Emotions
  • Files & Documents
  • Food & Drinks
  • Hands & Gestures
  • Home & Garden
  • Like & Dislike
  • Maps & Location
  • Medicine & Health
  • Messages & Chat
  • Money & Finance
  • Music & Audio
  • Nature & Travel
  • Network & Programming
  • Notes & Text
  • Notifications
  • School & Education
  • Search
  • Security
  • Settings
  • Shopping & E-commerce
  • Sports & Fitness
  • Text Formatting
  • Time & Calendar
  • Transport & Vehicles
  • Users & People
  • Video & Media
  • Weather

Usage Examples

In Laravel Views

<!-- Basic usage -->
<x-solar-linear-home class="w-6 h-6" />

<!-- With Tailwind CSS -->
<div class="flex items-center space-x-2">
    <x-solar-outline-user class="w-5 h-5 text-gray-500" />
    <span>User Profile</span>
</div>

<!-- Using @svg directive -->
@svg('solar-bold-settings', 'w-8 h-8 text-blue-600')

<!-- Dynamic icon selection -->
@php
    $iconName = $user->isActive() ? 'solar-linear-check-circle' : 'solar-outline-close-circle';
@endphp
<x-icon :name="$iconName" class="w-4 h-4" />

In Laravel Components

<?php

namespace App\View\Components;

use Illuminate\View\Component;
use Monsefeledrisse\LaravelSolarIcons\SolarIcon;

class StatusBadge extends Component
{
    public function __construct(
        public string $status,
        public string $label
    ) {}

    public function render()
    {
        $icon = match($this->status) {
            'active' => SolarIcon::LinearCheckCircle->value,
            'inactive' => SolarIcon::OutlineCloseCircle->value,
            'pending' => SolarIcon::LinearClock->value,
            default => SolarIcon::OutlineQuestion->value,
        };

        return view('components.status-badge', compact('icon'));
    }
}

In Controllers

<?php

namespace App\Http\Controllers;

use Monsefeledrisse\LaravelSolarIcons\SolarIcon;
use Monsefeledrisse\LaravelSolarIcons\SolarIconHelper;

class DashboardController extends Controller
{
    public function index()
    {
        $menuItems = [
            [
                'label' => 'Dashboard',
                'icon' => SolarIcon::Home->value,
                'url' => route('dashboard')
            ],
            [
                'label' => 'Users',
                'icon' => SolarIcon::Users->value,
                'url' => route('users.index')
            ],
            [
                'label' => 'Settings',
                'icon' => SolarIcon::Settings->value,
                'url' => route('settings')
            ],
        ];

        return view('dashboard', compact('menuItems'));
    }
}

Icon Style Guide

  • Linear: Perfect for clean, modern interfaces
  • Outline: Great for secondary actions and subtle elements
  • Bold: Use for primary actions and important status indicators
  • Duotone: Excellent for illustrations and decorative elements

Testing

This package includes a comprehensive test suite built with Pest PHP:

# Install dev dependencies
composer install --dev

# Run tests
composer test

# Or run Pest directly
./vendor/bin/pest

Test Coverage

The test suite covers:

  • Service provider registration and boot process
  • Icon set registration with correct prefixes and paths
  • Directory structure validation
  • BladeUI Icons Factory integration
  • Error handling and edge cases
  • Performance considerations
  • Memory management

Migration from Heroicons

Common Icon Mappings

Heroicon Solar Icon SolarIcon Enum
heroicon-o-home solar-linear-Home SolarIcon::Home->forSet('solar-linear')
heroicon-o-user solar-outline-User SolarIcon::User->forSet('solar-outline')
heroicon-o-cog-6-tooth solar-linear-Settings SolarIcon::Settings->forSet('solar-linear')
heroicon-o-bell solar-outline-Notification SolarIcon::Bell->forSet('solar-outline')
heroicon-o-calendar solar-linear-Calendar SolarIcon::Calendar->forSet('solar-linear')
heroicon-o-pencil solar-outline-Pen SolarIcon::Pen->forSet('solar-outline')
heroicon-o-trash solar-outline-trash_bin_minimalistic SolarIcon::TrashBinMinimalistic->forSet('solar-outline')

Helper Tools

use Monsefeledrisse\LaravelSolarIcons\SolarIconHelper;

// Search for icons
$suggestions = SolarIconHelper::searchIcons('user');

// Get all available icon files
$allIcons = SolarIconHelper::getAllIconFiles();

// Get icons by category
$navigationIcons = SolarIconHelper::getIconsByCategory('navigation');

Troubleshooting

Icons Not Displaying

  1. Check icon name spelling and ensure it exists
  2. Verify the icon style is available
  3. Clear cache: php artisan cache:clear
  4. Check file permissions on icon directories

Performance Optimization

  1. Disable unused icon sets in configuration
  2. Use specific icon sets instead of loading all sets
  3. Consider using SVG sprites for frequently used icons

Development

Requirements

  • PHP 8.1 or higher
  • Laravel 9.0 or higher
  • BladeUI Icons 1.8 or higher

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run the test suite (composer test)
  5. Commit your changes (git commit -m 'Add some amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

License

This package is open-sourced software licensed under the MIT license.

Credits

Auto-update test - GitHub-Packagist integration

monsefeledrisse/laravel-solar-icons 适用场景与选型建议

monsefeledrisse/laravel-solar-icons 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 13 次下载、GitHub Stars 达 5, 最近一次更新时间为 2025 年 08 月 03 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「ui」 「laravel」 「icons」 「svg」 「solar」 「blade-components」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

围绕 monsefeledrisse/laravel-solar-icons 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-08-03