abrardev/inspire-widget

A Filament widget that displays daily inspirational quotes

v1.0.0 2025-04-02 16:54 UTC

This package is auto-updated.

Last update: 2025-04-02 17:06:18 UTC


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.