PHP code example of filaforge / filament-hello-widget

1. Go to this page and download the library: Download filaforge/filament-hello-widget library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

filaforge / filament-hello-widget example snippets


use Filament\Panel;

public function panel(Panel $panel): Panel
{
    return $panel
        // ... other configuration
        ->plugin(\Filaforge\HelloWidget\HelloWidgetPlugin::make());
}

// config/hello-widget.php
return [
    'greeting' => 'Hello',
    'show_user_info' => true,
    'show_timestamp' => true,
    'custom_message' => 'Welcome to your dashboard!',
    'widget_position' => 'top',
    'refresh_interval' => 0, // 0 = no auto-refresh
    'allowed_roles' => [], // Empty = all authenticated users
];

// remove ->plugin(\Filaforge\HelloWidget\HelloWidgetPlugin::make())
bash
# Publish provider groups (config, views, migrations)
php artisan vendor:publish --provider="Filaforge\\HelloWidget\\Providers\\HelloWidgetServiceProvider"

# Run migrations
php artisan migrate
bash
php artisan tinker
# Check widget registration
bash
php artisan optimize:clear
php artisan view:clear
bash
php artisan vendor:publish --tag=hello-widget-views
bash
composer remove filaforge/hello-widget
php artisan optimize:clear