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.
composer require devonab/filament-easy-footer:^2.0
AppServiceProvider or Filament panel configuration:
use Devonab\FilamentEasyFooter\EasyFooterPlugin;
Filament::registerPanel(
FilamentPanel::make()
->plugins([
EasyFooterPlugin::make(),
])
);
php artisan vendor:publish --tag="filament-easy-footer-config"
Add a basic footer with your app name (from .env or config) and copyright notice:
EasyFooterPlugin::make()
->withSentence('© ' . now()->year . ' ' . config('app.name'))
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>'
))
Conditional Footer Rendering Hide footer on specific pages (e.g., auth pages):
->hiddenFromPagesEnabled()
->hiddenFromPages(['admin/login', 'admin/forgot-password'])
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),
],
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;
}
}
Link Management Add links dynamically via config or runtime:
->withLinks([
['title' => 'Documentation', 'url' => route('filament.pages.documentation')],
['title' => 'Support', 'url' => 'mailto:support@example.com'],
])
Filament::registerPanel(
FilamentPanel::make()
->id('admin')
->plugins([EasyFooterPlugin::make()->withSentence('Admin Panel')])
);
__() for translatable sentences:
->withSentence(__('filament-easy-footer.copyright', ['year' => now()->year]))
->withGithub(showLogo: true, cacheTTL: 7200) // 2-hour cache
Theme Conflicts
@source directive in filament.css points to the correct vendor path. Rebuild assets after changes:
npm run dev
GitHub Token Requirements
read:packages token or omit the token for public repos (version will show as "unknown").Render Hook Overrides
panels::footer) may conflict with other plugins.footer, sidebar, sidebar.footer) to avoid layout breaks.HTML Injection Risks
withSentence() accepts HTML, but unsanitized input may cause XSS.HtmlString for trusted HTML or sanitize input:
use Illuminate\Support\Str;
->withSentence(Str::of($userInput)->sanitizeHtml())
Asset Paths
/storage/logo.png) may break in production.asset() helper:
->withLogo(asset('images/logo.svg'), route('home'))
Footer Not Showing?
filament.css includes the @source directive.GitHub Version Failing
repo scope for private repos.user/repo):
'github' => ['repository' => 'devonab/filament-easy-footer']
Styling Issues
.fi-footer {
@apply bg-gray-800 text-gray-300 p-4;
}
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.
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')],
];
}
}
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');
}
})
);
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')
]))
How can I help you explore Laravel packages today?