Download the PHP package amarafiif/filament-lost-connection without Composer
On this page you can find all versions of the php package amarafiif/filament-lost-connection. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package filament-lost-connection
Filament Lost Connection
A beautiful and customizable network connection status indicator for Laravel Filament applications. This plugin automatically detects when users lose internet connectivity and displays a non-intrusive notification.
Features
- 🌐 Real-time connection monitoring
- 🎨 Fully customizable appearance and messages
- 📱 Responsive design with smooth animations
- ⚙️ Flexible configuration options
- 🔧 Custom ping URL support
- 🎯 Easy integration with Filament panels
Installation
You can install the package via Composer:
Configuration
Option 1: Using Configuration File (Recommended)
Publish the configuration file:
This will create a config/filament-lost-connection.php file where you can customize all settings:
Option 2: Using Fluent API
Register the plugin in your Filament Panel Provider (e.g., app/Providers/Filament/AdminPanelProvider.php):
Usage Examples
Basic Usage
Custom Messages
Custom Styling
Custom Ping URL
Environment Variables
You can also configure the plugin using environment variables in your .env file:
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
position |
string | 'bottom' |
Position of indicator ('top' or 'bottom') |
lostConnectionText |
string | 'You are disconnected.' |
Message when connection is lost |
connectedText |
string | 'You are back online.' |
Message when connection is restored |
lostConnectionColor |
string | '#991b1b' |
Background color when offline |
connectedColor |
string | '#065f46' |
Background color when back online |
checkInterval |
int | 3000 |
Check interval in milliseconds |
icon |
string | 'heroicon-o-exclamation-triangle' |
Icon component to display |
pingUrl |
string | null |
Custom URL to ping (defaults to domain favicon) |
How It Works
The plugin uses multiple methods to detect connectivity:
- Browser Events: Listens to
onlineandofflineevents - HTTP Requests: Periodically sends HEAD requests to check connectivity
- Navigator API: Falls back to
navigator.onLineas a backup
Ping URL Options
- Default: Uses your domain's favicon (
/favicon.ico) - Custom: You can specify any URL to ping
- Popular options:
https://www.google.com/favicon.icohttps://httpbin.org/status/200https://1.1.1.1/favicon.ico
Customization
Custom Views
You can publish and customize the views:
This will publish the views to resources/views/vendor/filament-lost-connection/.
Styling
The component uses Tailwind CSS classes and can be easily customized through the color options or by modifying the published views.
Troubleshooting
Plugin Not Showing
- Make sure you've registered the plugin in your Panel Provider
- Check that the plugin is using the correct render hook:
panels::body.end - Ensure your views are properly loaded by the service provider
Connection Check Not Working
- Verify your
pingUrlis accessible and returns a successful response - Check browser console for any CORS issues
- Try different ping URLs if the default doesn't work in your environment
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
The MIT License (MIT). Please see License File for more information.
Credits
- Muhammad Ammar Afif
- All Contributors
Support
If you find this package helpful, please consider giving it a ⭐ on GitHub!
All versions of filament-lost-connection with dependencies
illuminate/support Version ^10.0|^11.0
illuminate/view Version ^10.0|^11.0
filament/filament Version ^3.0