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 Easy Footer Laravel Package

devonab/filament-easy-footer

Add a customizable footer to your Filament admin with minimal setup. Configure position, custom text, logo + link, extra links, top border, optional GitHub version and page load time, enable/disable globally, and hide it on specific pages.

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Install the package:
    composer require devonab/filament-easy-footer:^2.0
    
  2. Register the plugin in your AppServiceProvider or Filament panel configuration:
    use Devonab\FilamentEasyFooter\EasyFooterPlugin;
    
    Filament::registerPanel(
        FilamentPanel::make()
            ->plugins([
                EasyFooterPlugin::make(),
            ])
    );
    
  3. Publish config (optional, for customization):
    php artisan vendor:publish --tag="filament-easy-footer-config"
    

First Use Case

Add a basic footer with your app name (from .env or config) and copyright notice:

EasyFooterPlugin::make()
    ->withSentence('© ' . now()->year . ' ' . config('app.name'))

Implementation Patterns

Common Workflows

  1. Dynamic Footer Content Use withSentence() with HtmlString for dynamic content:

    use Illuminate\Support\HtmlString;
    
    ->withSentence(new HtmlString(
        '<img src="/logo.svg" width="20"> ' .
        'Powered by <strong>' . config('app.name') . '</strong>'
    ))
    
  2. Conditional Footer Rendering Hide footer on specific pages (e.g., auth pages):

    ->hiddenFromPagesEnabled()
        ->hiddenFromPages(['admin/login', 'admin/forgot-password'])
    
  3. Multi-Environment Config Override config per environment (e.g., config/filament-easy-footer.php):

    'github' => [
        'repository' => env('GITHUB_REPO', null),
        'token' => env('GITHUB_TOKEN', null),
    ],
    
  4. Theming Integration Extend your custom theme (resources/css/filament/filament.css):

    @source '../../../../vendor/devonab/filament-easy-footer/resources/views/**/*';
    @layer filament-components {
        .fi-footer {
            background: #1a1a1a;
            color: #ccc;
        }
    }
    
  5. Link Management Add links dynamically via config or runtime:

    ->withLinks([
        ['title' => 'Documentation', 'url' => route('filament.pages.documentation')],
        ['title' => 'Support', 'url' => 'mailto:support@example.com'],
    ])
    

Integration Tips

  • Panel-Specific Customization: Register the plugin per panel for different footers:
    Filament::registerPanel(
        FilamentPanel::make()
            ->id('admin')
            ->plugins([EasyFooterPlugin::make()->withSentence('Admin Panel')])
    );
    
  • Localization: Use __() for translatable sentences:
    ->withSentence(__('filament-easy-footer.copyright', ['year' => now()->year]))
    
  • Performance: Cache GitHub version checks (default TTL: 3600s):
    ->withGithub(showLogo: true, cacheTTL: 7200) // 2-hour cache
    

Gotchas and Tips

Pitfalls

  1. Theme Conflicts

    • Issue: Footer styles may not apply if your custom theme overrides Filament’s default styles.
    • Fix: Ensure @source directive in filament.css points to the correct vendor path. Rebuild assets after changes:
      npm run dev
      
  2. GitHub Token Requirements

    • Issue: Private repositories require a token, but public repos may fail without one.
    • Fix: Use a minimal read:packages token or omit the token for public repos (version will show as "unknown").
  3. Render Hook Overrides

    • Issue: Custom render hooks (e.g., panels::footer) may conflict with other plugins.
    • Fix: Test positions (footer, sidebar, sidebar.footer) to avoid layout breaks.
  4. HTML Injection Risks

    • Issue: withSentence() accepts HTML, but unsanitized input may cause XSS.
    • Fix: Use HtmlString for trusted HTML or sanitize input:
      use Illuminate\Support\Str;
      ->withSentence(Str::of($userInput)->sanitizeHtml())
      
  5. Asset Paths

    • Issue: Local logo paths (e.g., /storage/logo.png) may break in production.
    • Fix: Use absolute URLs or asset() helper:
      ->withLogo(asset('images/logo.svg'), route('home'))
      

Debugging

  • Footer Not Showing?

    • Check if the plugin is registered in the correct panel.
    • Verify no JavaScript errors block render hooks (inspect browser console).
    • Ensure filament.css includes the @source directive.
  • GitHub Version Failing

    • Validate the token has repo scope for private repos.
    • Check the repository name format (user/repo):
      'github' => ['repository' => 'devonab/filament-easy-footer']
      
  • Styling Issues

    • Override Tailwind classes in your theme:
      .fi-footer {
          @apply bg-gray-800 text-gray-300 p-4;
      }
      

Extension Points

  1. Custom Views Publish and override views:

    php artisan vendor:publish --tag="filament-easy-footer-views"
    

    Modify resources/views/vendor/filament-easy-footer/footer.blade.php.

  2. Dynamic Data Extend the plugin class to fetch data at runtime:

    class CustomFooterPlugin extends EasyFooterPlugin {
        public function getDynamicLinks(): array {
            return [
                ['title' => 'API Docs', 'url' => route('api.docs')],
            ];
        }
    }
    
  3. Event Listeners Hook into Filament events to modify footer data:

    Filament::registerPanel(
        FilamentPanel::make()
            ->plugins([EasyFooterPlugin::make()])
            ->middleware(function ($request) {
                if ($request->user()->isAdmin()) {
                    EasyFooterPlugin::make()->withSentence('Admin Mode');
                }
            })
    );
    
  4. Localization Add translations to resources/lang/en/filament-easy-footer.php:

    return [
        'copyright' => '© :year <strong>:app</strong>. All rights reserved.',
    ];
    

    Use in withSentence():

    ->withSentence(__('filament-easy-footer.copyright', [
        'year' => now()->year,
        'app' => config('app.name')
    ]))
    
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.
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi