abrardev/inspire-widget 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

abrardev/inspire-widget

最新稳定版本:v1.0.0

Composer 安装命令:

composer require abrardev/inspire-widget

包简介

A Filament widget that displays daily inspirational quotes

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A fun little Filament widget that displays daily inspirational quotes.

Demo

dark screenshot

light screenshot

Installation

You can install the package via composer:

composer require abrardev/inspire-widget

Optionally, you can publish the views using

php artisan vendor:publish --tag="inspire-widget-views"

Usage

Register Plugin

In your Filament panel provider, register the plugin as

use AbrarDev\InspireWidget\InspireWidgetPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            InspireWidgetPlugin::make()
        ])
}

Active Widget

You can activate widget on dashboard page as follows:

use AbrarDev\InspireWidget\Widget\InspireWidget;

public function panel(Panel $panel): Panel
{
    return $panel
            ->widgets([
                Widgets\AccountWidget::class,
                Widgets\FilamentInfoWidget::class,
                InspireWidget::class,
            ])
}

InspireWidget will show on top since it has top sorting.

Customization

Providing your own quotes

You can use plugin to provide an array of your own quotes and Widget will pick them randomally as follows

use AbrarDev\InspireWidget\InspireWidgetPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            InspireWidgetPlugin::make()
                ->quotes([
                        'The only limit to our realization of tomorrow is our doubts of today.',
                        'The future belongs to those who believe in the beauty of their dreams.',
                        'Do not wait to strike till the iron is hot, but make it hot by striking.',
                    ])
        ])
}

Providing your own image

You can also provide your own image. Make sure image is 2084 x 252

use AbrarDev\InspireWidget\InspireWidgetPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            InspireWidgetPlugin::make()
                ->image(
                    new Image(asset('vendor/inspire-widget/images/patrick-carr-pAoo1Rs1Yy8-unsplash.jpg'),
                        __('Photo by :author on :service')
                    )
                )
        ])
}

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-04-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固