Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Filament Donkey Laravel Package

avexsoft/filament-donkey

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation

    composer require avexsoft/filament-donkey
    

    Publish the migration and config:

    php artisan vendor:publish --provider="Avexsoft\FilamentDonkey\FilamentDonkeyServiceProvider" --tag="migrations"
    php artisan vendor:publish --provider="Avexsoft\FilamentDonkey\FilamentDonkeyServiceProvider" --tag="config"
    

    Run migrations:

    php artisan migrate
    
  2. Register the Plugin Add to app/Providers/Filament/AdminPanelProvider.php:

    public function panel(Panel $panel): Panel
    {
        return $panel
            ->plugins([
                \Avexsoft\FilamentDonkey\FilamentDonkeyPlugin::make(),
            ]);
    }
    
  3. First Use Case

    • Navigate to the FilamentDonkey plugin in your Filament admin panel.
    • Use the UI to override a config value (e.g., app.timezone) for production without touching .env.
    • Save and verify changes via config('app.timezone') in Tinker or a test route.

Implementation Patterns

Workflows

  1. Dynamic Config Overrides

    • Use the plugin to temporarily adjust configs (e.g., queue.driver, mail.mailers.smtp.host) without redeploying.
    • Example: Disable queue workers in production for maintenance:
      // Via FilamentDonkey UI:
      // Key: `queue.default`, Value: `sync`
      
  2. Environment-Specific Toggles

    • Store configs in the database and filter by environment (e.g., production only).
    • Use the FilamentDonkey facade to fetch values programmatically:
      $value = \FilamentDonkey::get('app.debug', false); // Returns false if not set
      
  3. Integration with Filament Forms

    • Extend a Filament resource to preload config values from the plugin:
      use Avexsoft\FilamentDonkey\Facades\FilamentDonkey;
      
      public static function form(Form $form): Form
      {
          return $form->schema([
              TextInput::make('timezone')
                  ->default(FilamentDonkey::get('app.timezone', 'UTC')),
          ]);
      }
      
  4. Scheduled Config Updates

    • Use Laravel’s scheduler to update configs via API (e.g., rotate API keys):
      * * * * * cd /path-to-project && php artisan filament-donkey:update --key="services.api.key" --value="new-value"
      

Best Practices

  • Prefix Keys: Use namespaced keys (e.g., donkey.cache.driver) to avoid collisions.
  • Backup Configs: Export configs periodically:
    php artisan filament-donkey:export --path="config_backup.json"
    
  • Validation: Leverage Filament’s validation rules in the plugin’s form:
    TextInput::make('queue.driver')
        ->options(['sync', 'database', 'redis'])
        ->required(),
    

Gotchas and Tips

Pitfalls

  1. Cache Invalidation

    • Config changes won’t reflect in cached views until:
      php artisan config:clear
      php artisan view:clear
      
    • Tip: Use FilamentDonkey::flushCache() in a post-update event.
  2. Environment Filtering

    • The plugin ignores configs not marked for the current environment by default.
    • Fix: Explicitly set environment: null in the UI to bypass filtering.
  3. Database Bloat

    • Unused configs accumulate. Prune old entries via:
      php artisan filament-donkey:prune --older-than="30 days"
      
  4. Permission Issues

    • Ensure the Filament user has filament-donkey.update permission in your Filament policy.

Debugging

  • Check Raw Data:
    php artisan tinker
    >>> \Avexsoft\FilamentDonkey\Models\Config::all()->toArray();
    
  • Log Updates: Enable debug mode in config/filament-donkey.php:
    'debug' => env('FILAMENT_DONKEY_DEBUG', false),
    
    Then check storage/logs/laravel.log for update events.

Extension Points

  1. Custom Storage Override the default Eloquent model:

    // config/filament-donkey.php
    'model' => \App\Models\CustomDonkeyConfig::class,
    

    Ensure CustomDonkeyConfig extends \Avexsoft\FilamentDonkey\Models\Config.

  2. Webhook Triggers Dispatch events on config updates:

    // app/Providers/EventServiceProvider.php
    public function boot()
    {
        \Avexsoft\FilamentDonkey\Events\ConfigUpdated::dispatch(
            $configKey, $oldValue, $newValue
        );
    }
    
  3. API Access Expose configs via a custom API route:

    Route::get('/api/config/{key}', function ($key) {
        return \FilamentDonkey::get($key);
    });
    
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle