mohamed-elsayed-ibrahim / filament-lockscreen
A lockscreen plugin for Filament v3 with inactivity timeout and secure unlock functionality.
Package info
github.com/mohamedElsayedIbrahim/filament-lock-screen
pkg:composer/mohamed-elsayed-ibrahim/filament-lockscreen
Requires
- php: ^8.1
- filament/filament: ^3.0
- illuminate/routing: ^10.0|^11.0
- illuminate/support: ^10.0|^11.0
- illuminate/view: ^10.0|^11.0
Requires (Dev)
- laravel/pint: ^1.13
- orchestra/testbench: 9.0
- phpunit/phpunit: ^10.5|^11.0
README
A modern lock screen plugin for Filament v3 that automatically locks inactive sessions and requires password re-authentication without logging users out.
Features
- 🔒 Automatic session locking after inactivity
- 🔓 Secure password-based unlock
- 🎨 Modern overlay lock screen
- ⚡ Native Filament v3 integration
- 🧩 Plugin-based architecture
- 📡 Lock / Unlock events
- ⚙️ Configurable timeout
- 🚀 No database tables required
- 🔐 Session-based security
- 🎯 Easy installation and setup
Requirements
| Package | Version |
|---|---|
| PHP | 8.1+ |
| Laravel | 10.x / 11.x |
| Filament | 3.x |
Installation
Install the package via Composer:
composer require mohamed-elsayed-ibrahim/filament-lockscreen
Publish Configuration
php artisan vendor:publish --tag=filament-lock-screen-config
This will create:
config/filament-lock-screen.php
Configuration
return [ /* |-------------------------------------------------------------------------- | Enable / Disable Plugin |-------------------------------------------------------------------------- */ 'enabled' => true, /* |-------------------------------------------------------------------------- | Session Timeout (seconds) |-------------------------------------------------------------------------- */ 'timeout' => env('FILAMENT_LOCK_TIMEOUT', 900), /* |-------------------------------------------------------------------------- | Authentication Guard |-------------------------------------------------------------------------- */ 'guard' => 'web', /* |-------------------------------------------------------------------------- | Require Password Verification |-------------------------------------------------------------------------- */ 'password_check' => true, ];
Register the Plugin
Inside your Filament Panel Provider:
use MohamedElsayedIbrahim\FilamentLockScreen\FilamentLockScreenPlugin; public function panel(Panel $panel): Panel { return $panel ->plugins([ FilamentLockScreenPlugin::make(), ]); }
How It Works
Activity Tracking
The plugin continuously tracks authenticated user activity.
When no activity occurs within the configured timeout period:
- Session becomes locked.
- Overlay appears immediately.
- User interaction is blocked.
- Password verification is required.
Unlock Process
The user enters their current password.
The plugin validates it using Laravel's hashing system:
Hash::check( $password, auth()->user()->password );
If valid:
- Session is restored
- Lock state is removed
- User continues working without page reload
Events
Locked Event
use MohamedElsayedIbrahim\FilamentLockScreen\Events\Locked;
Example:
Event::listen(Locked::class, function (Locked $event) { logger()->info( 'User locked', ['user_id' => $event->user->id] ); });
Unlocked Event
use MohamedElsayedIbrahim\FilamentLockScreen\Events\Unlocked;
Example:
Event::listen(Unlocked::class, function (Unlocked $event) { logger()->info( 'User unlocked', ['user_id' => $event->user->id] ); });
Customizing the View
Publish views:
php artisan vendor:publish --tag=filament-lock-screen-views
Published location:
resources/views/vendor/filament-lock-screen
You can fully customize:
- Colors
- Branding
- Logo
- Layout
- Animations
- Typography
Example Environment Variables
FILAMENT_LOCK_TIMEOUT=900
Common Values
| Time | Seconds |
|---|---|
| 5 Minutes | 300 |
| 10 Minutes | 600 |
| 15 Minutes | 900 |
| 30 Minutes | 1800 |
| 1 Hour | 3600 |
Security
The plugin:
- Never stores passwords
- Uses Laravel Hash verification
- Uses session-based locking
- Works with Filament authentication
- Prevents unauthorized access to active sessions
Architecture
src/
├── Contracts/
├── Events/
├── Http/
│ └── Middleware/
├── Livewire/
├── FilamentLockScreenPlugin.php
└── FilamentLockScreenServiceProvider.php
Roadmap
Planned Features
- PIN Unlock Mode
- Biometric Unlock Support
- Multi-panel Support
- User-specific Timeout Settings
- Role-based Lock Policies
- Audit Log Integration
- Browser Activity Detection
- Dark Mode Optimizations
- Team Admin Override
Testing
Run tests:
composer test
or
vendor/bin/phpunit
Contributing
Contributions are welcome.
- Fork the repository
- Create a feature branch
git checkout -b feature/my-feature
- Commit your changes
git commit -m "Add my feature"
- Push to GitHub
git push origin feature/my-feature
- Open a Pull Request
Changelog
Please see CHANGELOG.md for more information on recent updates.
License
The MIT License (MIT).
Credits
- Laravel
- FilamentPHP
- Livewire
Support
If you discover a bug or have a feature request, please open an issue on GitHub.
GitHub Repository:
https://github.com/mohamedElsayedIbrahim/filament-lock-screen
Made with ❤️ for the Filament community.