承接 devonab/filament-easy-footer 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

devonab/filament-easy-footer

Composer 安装命令:

composer require devonab/filament-easy-footer

包简介

A simple plugin to display a customizable footer in your filament application!

README 文档

README

Filament Easy Footer cover

Latest v2.x Tests Code Style Total Downloads

FilamentPHP Package version Branch
v3.x v1.x filament-v3
v4.x v2.x main
v5.x v2.x main

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.

Navigation

Installation

First, you can start to install the package via composer:

composer require devonab/filament-easy-footer:^2.0

You can publish the config file with. This file is needed if you want to change the default:

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' => null,

    'github' => [
        'repository' => null,
        'token' => null,
        'cache_ttl' => 3600,
    ],
];

Usage

To start using this plugin, simply add it to the Filament provider's plugin array.

use Devonab\FilamentEasyFooter\EasyFooterPlugin;

->plugins([
    EasyFooterPlugin::make(),
])

Custom theme

You will need to create a custom theme for the footer styles to be applied correctly.

Once that is done, add this line to your theme.css file before compiling everything with npm run build.

@source '../../../../vendor/devonab/filament-easy-footer/resources/views/**/*';

Configurations

Enable or Disable the Footer

You can enable or disable the footer entirely using the following configuration:

use Devonab\FilamentEasyFooter\EasyFooterPlugin;

->plugins([
    EasyFooterPlugin::make()
    ->footerEnabled() // true by default,
]);

Without this configuration, the footer will be enabled by default.

Footer position

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.end
  • sidebar.footer : panels::sidebar.footer
use Devonab\FilamentEasyFooter\EasyFooterPlugin;

->plugins([
    EasyFooterPlugin::make()
    ->withFooterPosition('footer'),
])

Filament Easy Footer position

use Devonab\FilamentEasyFooter\EasyFooterPlugin;

->plugins([
    EasyFooterPlugin::make()
    ->withFooterPosition('sidebar'),
])

Filament Easy Footer sidebar position

use Devonab\FilamentEasyFooter\EasyFooterPlugin;

->plugins([
    EasyFooterPlugin::make()
    ->withFooterPosition('sidebar.footer'),
])

Filament Easy Footer sidebar footer position

Custom sentence

Filament Easy Footer custom sentence

By default, the plugin will display the name of your application (configured from your .ENV), or the app_name key in the plugin config file,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><a><em><span><b><i><small>.

Show GitHub version

Filament Easy Footer github

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 publish the plugin configuration file and set the following keys :

return [
    'app_name' => null,

    'github' => [
        'repository' => null, #user/name-of-the-repo
        'token' => null, # Recommended but not compulsory for all repos, required for private repos
        'cache_ttl' => 3600, # in seconds, 3600 by default
    ],
];

If needed, you can generate a token here. The token need to have at least the read-only permission on the "Contents" scope in Repository permissions.

Show installed version

You can show the currently installed Composer version of your application in the footer by using this configuration :

use Devonab\FilamentEasyFooter\EasyFooterPlugin;

->plugins([
    EasyFooterPlugin::make()
    ->withShowInstalledVersion()
])

This works independently of ->withGithub() and does not perform any GitHub API call: it only reads the version Composer resolved for your application.

If you also want to compare it against the latest GitHub release and flag when an update is available, combine it with ->withGithub() :

use Devonab\FilamentEasyFooter\EasyFooterPlugin;

->plugins([
    EasyFooterPlugin::make()
    ->withGithub()
    ->withShowInstalledVersion(showLatest: true, showUpdatable: true)
])
  • showLatest : Display the latest GitHub release next to the installed version
  • showUpdatable : Display an "available" badge when the installed version is older than the latest release

showLatest and showUpdatable require ->withGithub() to be enabled, since they need to fetch the latest tag from GitHub.

If Composer cannot resolve the installed version (for example, the application isn't checked out from its VCS), you can provide a fallback config key that will be read instead :

return [
    'app_name' => null,

    'github' => [
        'repository' => null,
        'token' => null,
        'cache_ttl' => 3600,
    ],

    'versioning' => [
        'local_fallback_config_key' => null, # e.g. 'app.version'
    ],
];

Load time

Filament Easy Footer load time

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'),
])

Filament Easy Footer loadtime prefix

Custom logo with link

Filament Easy Footer custom logo

Custom logo with link

Filament Easy Footer custom logo

You can add a custom logo with optional link and text to the footer by using this configuration:

use Devonab\FilamentEasyFooter\EasyFooterPlugin;

->plugins([
    EasyFooterPlugin::make()
        ->withLogo(
            'https://static.cdnlogo.com/logos/l/23/laravel.svg', // Path to logo
            'https://laravel.com'                                // URL for logo link (optional)
        )
])

You can customize the logo further with optional text and height:

use Devonab\FilamentEasyFooter\EasyFooterPlugin;

->plugins([
    EasyFooterPlugin::make()
        ->withLogo(
            'https://static.cdnlogo.com/logos/l/23/laravel.svg', // Path to logo
            'https://laravel.com',                               // URL for logo link (optional)
            'Powered by Laravel',                                // Text to display (optional)
            35                                                   // Logo height in pixels (default: 20)
        )
])

If you don't need the link, you can pass null for the second parameter:

use Devonab\FilamentEasyFooter\EasyFooterPlugin;

->plugins([
    EasyFooterPlugin::make()
        ->withLogo(
            'https://static.cdnlogo.com/logos/l/23/laravel.svg', // Path to logo
            null,                                                // No link
            null,                                                // No text
            60                                                   // Logo height in pixels
        )
])

Links

Filament Easy Footer links

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']
    ]),
])

Border on top

You can add a border on the top of the footer by using this configuration :

use Devonab\FilamentEasyFooter\EasyFooterPlugin;

->plugins([
    EasyFooterPlugin::make()
    ->withBorder(),
])

Hiding from specific pages

By default, the footer is also showed on the 3 auth pages : admin/login, admin/forgot-password and admin/register. You can hide it by using this configuration :

use Devonab\FilamentEasyFooter\EasyFooterPlugin;

->plugins([
    EasyFooterPlugin::make()
    ->hiddenFromPagesEnabled(),
])

If you would like to hide the footer on other pages, you can use this configuration :

use Devonab\FilamentEasyFooter\EasyFooterPlugin;

->plugins([
    EasyFooterPlugin::make()
    ->hiddenFromPagesEnabled()
    ->hiddenFromPages(['sample-page', 'another-page', 'admin/login', 'admin/forgot-password', 'admin/register']),
])

Note that anything set in hiddenFromPages() will override the default behavior.

Testing

You can run the test with this command

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

devonab/filament-easy-footer 适用场景与选型建议

devonab/filament-easy-footer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 82.96k 次下载、GitHub Stars 达 39, 最近一次更新时间为 2024 年 12 月 28 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「filament」 「filament-php」 「Devonab」 「filament-easy-footer」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 devonab/filament-easy-footer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 devonab/filament-easy-footer 我们能提供哪些服务?
定制开发 / 二次开发

基于 devonab/filament-easy-footer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 82.96k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 39
  • 点击次数: 14
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 39
  • Watchers: 2
  • Forks: 14
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-12-28