承接 eightcedars/filament-inactivity-guard 相关项目开发

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

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

eightcedars/filament-inactivity-guard

最新稳定版本:1.0.0

Composer 安装命令:

composer require eightcedars/filament-inactivity-guard

包简介

Gracefully auto-logout users from idle/inactive Filament sessions

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Guard your Filament dashboard from inactive sessions. Log users out after a predefined period of inactivity.

Installation

You can install the package via composer:

composer require eightcedars/filament-inactivity-guard

You can publish the config file with:

php artisan vendor:publish --tag="filament-inactivity-guard-config"

This is the contents of the published config file:

return [
     /**
     * Determine if the plugin is enabled
     */
    'enabled' => true,

    /**
     * How long to wait before an idle session is considered inactive.
     * This value must be in seconds
     */
    'inactivity_timeout' => Carbon::SECONDS_PER_MINUTE * 14,

    /**
     * How long to show an inactive session notice before logging the user out.
     * This value must be in seconds
     *
     * Set this to null or 0 to disable the notice and log out immediately a user's session becomes inactive
     */
    'notice_timeout' => 60,

    /**
     * This package watches for a list of browser events to determine if a user is still active.
     * You may customise as desired.
     *
     * Ensure that the list is not empty
     */
    'interaction_events' => ['mousemove', 'keydown', 'click', 'scroll'],
];

Optionally, you can publish the translation files using

php artisan vendor:publish --tag="filament-inactivity-guard-translations"

You can also publish the view files using

php artisan vendor:publish --tag="filament-inactivity-guard-views"

Usage

Add the plugin class to your panel ServiceProvider

use EightCedars\FilamentInactivityGuard\FilamentInactivityGuardPlugin;

$panel
    ...
    ->plugin(FilamentInactivityGuardPlugin::make())
    ...

You may also configure the plugin behaviour in your service provider instead of publishing and editing the config file:

use EightCedars\FilamentInactivityGuard\FilamentInactivityGuardPlugin;use Illuminate\Support\Carbon;$panel
    ...
    ->plugin(
        FilamentInactivityGuardPlugin::make()
            ->inactiveAfter(5*Carbon::SECONDS_PER_MINUTE)
            ->showNoticeFor(1* Carbon::SECONDS_PER_MINUTE)
            // Or set to null to logout immediately after inactivity
            ->showNoticeFor(null)
            
            ->enabled(!app()->isLocal())
            ->keepActiveOn(['change', 'select', 'mousemove'], mergeWithDefaults: true),
    )
    ...

Screenshots:

Testing

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.

统计信息

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

GitHub 信息

  • Stars: 22
  • Watchers: 0
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固