This filament Plugin provides an easy and flexible way to add a customizable footer to your FilamentPHP application. This plugin integrates seamlessly with Filament's admin interface, enabling you to enhance your application's user experience with a good looking footer.
- Installation
- Usage
- Configurations
- Testing
- Contributing
- Changelog
- Security Vulnerabilities
- Credits
- License
First, you can start to install the package via composer:
composer require devonab/filament-easy-footer
You can publish the config file with:
php artisan vendor:publish --tag="filament-easy-footer-config"
Optionally, you can publish the views using
php artisan vendor:publish --tag="filament-easy-footer-views"
This is the contents of the published config file:
return [
'app_name' => env('APP_NAME', 'Filament Footer'),
'github' => [
'repository' => env('GITHUB_REPOSITORY', ''),
'token' => env('GITHUB_TOKEN', ''),
'cache_ttl' => env('GITHUB_CACHE_TTL', 3600)
],
];
To start using this plugin, simply add it to the Filament provider's plugin array.
use Devonab\FilamentEasyFooter\EasyFooterPlugin;
->plugins([
EasyFooterPlugin::make(),
])
You can choose the position of the footer by using this configuration :
use Devonab\FilamentEasyFooter\EasyFooterPlugin;
->plugins([
EasyFooterPlugin::make()
->withFooterPosition('footer'),
])
You can choose between 3 positions, represented by their corresponding render hooks
footer
: panels::footer (by default)sidebar
: panels::sidebar.nav.endsidebar.footer
: panels::sidebar.footer
use Devonab\FilamentEasyFooter\EasyFooterPlugin;
->plugins([
EasyFooterPlugin::make()
->withFooterPosition('footer'),
])
use Devonab\FilamentEasyFooter\EasyFooterPlugin;
->plugins([
EasyFooterPlugin::make()
->withFooterPosition('sidebar'),
])
use Devonab\FilamentEasyFooter\EasyFooterPlugin;
->plugins([
EasyFooterPlugin::make()
->withFooterPosition('sidebar.footer'),
])
By default, the plugin will display the name of your application (configured from your .ENV) next to the copyright. You can change the phrase by publishing the plugin configuration file.
If you prefer a more personalized approach, you can use the following method:
use Devonab\FilamentEasyFooter\EasyFooterPlugin;
->plugins([
EasyFooterPlugin::make()
->withSentence('your sentence'),
])
The method accepts a string or HTMLString as a parameter. With this, you can get the result you want. For example, for the result shown in the image above :
use Devonab\FilamentEasyFooter\EasyFooterPlugin;
->plugins([
EasyFooterPlugin::make()
->withSentence(new HtmlString('<img src="https://static.cdnlogo.com/logos/l/23/laravel.svg" style="margin-right:.5rem;" alt="Laravel Logo" width="20" height="20"> Laravel'))
,
])
The authorized tags are as follows: <strong><img><em><span><b><i><small>
.
You can show the GitHub version of your application by using this configuration :
use Devonab\FilamentEasyFooter\EasyFooterPlugin;
->plugins([
EasyFooterPlugin::make()
->withGithub(showLogo: true, showUrl: true)
])
- showLogo : Display the GitHub logo next to the version
- showUrl : Add an
<a>
tag to the Github URL around the logo
To make this one work, you need to add this keys to our .env file :
GITHUB_REPOSITORY=user/name-of-the-repo
GITHUB_TOKEN=
GITHUB_CACHE_TTL= # in seconds, 3600 by default
You can generate a token here. The token need to have at least the read-only
permission on the "Contents" scope in Repository permissions.
If you want to display the page load time, you can use this configuration :
use Devonab\FilamentEasyFooter\EasyFooterPlugin;
->plugins([
EasyFooterPlugin::make()
->withLoadTime(),
])
You can also display a prefix by using this configuration :
use Devonab\FilamentEasyFooter\EasyFooterPlugin;
->plugins([
EasyFooterPlugin::make()
->withLoadTime('This page loaded in'),
])
You can add custom logo with link to the footer by using this configuration :
use Devonab\FilamentEasyFooter\EasyFooterPlugin;
->plugins([
EasyFooterPlugin::make()
->withLogo('https://static.cdnlogo.com/logos/l/23/laravel.svg', 'https://laravel.com')
])
You're not obliged to add a link, and if you wish, you can specify the height of the logo as a parameter (default: 20px).
use Devonab\FilamentEasyFooter\EasyFooterPlugin;
->plugins([
EasyFooterPlugin::make()
->withLogo('https://static.cdnlogo.com/logos/l/23/laravel.svg', null, 60)
])
You can add custom links (3 links max) to the footer by using this configuration :
use Devonab\FilamentEasyFooter\EasyFooterPlugin;
->plugins([
EasyFooterPlugin::make()
->withLinks([
['title' => 'About', 'url' => 'https://example.com/about'],
['title' => 'CGV', 'url' => 'https://example.com/cgv'],
['title' => 'Privacy Policy', 'url' => 'https://example.com/privacy-policy']
]),
])
You can add a border on the top of the footer by using this configuration :
use Devonab\FilamentEasyFooter\EasyFooterPlugin;
->plugins([
EasyFooterPlugin::make()
->withBorder(),
])
By default, the footer is also showed on the 3 auth pages : login, forgot-password and register. You can hide it by using this configuration :
use Devonab\FilamentEasyFooter\EasyFooterPlugin;
->plugins([
EasyFooterPlugin::make()
->hideFromAuthPages(),
])
You can run the test with this command
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.