Download the PHP package alareqi/filament-pwa without Composer
On this page you can find all versions of the php package alareqi/filament-pwa. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alareqi/filament-pwa
More information about alareqi/filament-pwa
Files in alareqi/filament-pwa
Package filament-pwa
Short Description A comprehensive PWA (Progressive Web App) plugin for Filament v3 and v4 admin panels with offline functionality, installation prompts, and icon generation.
License MIT
Homepage https://github.com/aymanalareqi/filament-pwa
Informations about the package filament-pwa
Filament PWA Plugin
A comprehensive Progressive Web App (PWA) plugin for Filament v3 and v4 admin panels. Transform your Filament admin panel into a fully-featured PWA with offline functionality, installation prompts, automatic icon generation, and comprehensive internationalization support.
โจ Features
- ๐ Complete PWA Implementation - Full PWA compliance with manifest, service worker, and offline functionality
- ๐ฑ Smart Installation Prompts - Intelligent installation banners with platform-specific instructions (iOS, Android, Desktop)
- ๐จ Automatic Icon Generation - Generate all required PWA icons from a single source image (SVG or PNG) with maskable icon support
- ๐ Comprehensive Offline Support - Advanced caching strategies, offline fallback pages, and sync capabilities
- ๐ Full Internationalization - Built-in translations for 10+ languages with RTL/LTR support
- ๐ง Highly Configurable - Extensive configuration options with fluent API and closure-based dynamic configuration
- ๐ฏ Seamless Filament Integration - Native integration with Filament v3 & v4 panels using render hooks
- ๐ Validation & Debug Tools - Built-in PWA validation, testing commands, and debug mode
- ๐จ Smart Defaults - Advanced auto-detection of theme colors, language, and text direction from Filament/Laravel configuration
- โก Performance Optimized - Efficient caching strategies and minimal overhead
๐ Table of Contents
- Requirements
- Installation & Setup
- Quick Start
- Configuration
- Internationalization
- Icon Generation
- Advanced Features
- Troubleshooting
- API Reference
- Contributing
๐ Requirements
System Requirements
- PHP: 8.2 or higher
- Laravel: 10.0 or higher
- Filament: 3.0 or 4.0
Optional Dependencies
- Imagick Extension (recommended) - For high-quality icon generation
- GD Extension (fallback) - Basic image processing support
- Intervention Image (optional) - Enhanced image processing capabilities
Browser Support
- Chrome/Chromium - Full PWA support
- Firefox - PWA support with some limitations
- Safari - Limited PWA support, manual installation required on iOS
- Edge - Full PWA support
Production Requirements
- HTTPS - Required for PWA functionality in production
- Valid SSL Certificate - For secure service worker registration
- Web Server - Apache, Nginx, or similar with proper MIME type configuration
๐ Installation & Setup
Step 1: Install the Package
Install the package via Composer:
Note: This package supports both Filament v3 and v4. The installation process is identical for both versions.
Step 2: Publish Assets (Optional)
Publish the configuration file and assets:
Step 3: Generate PWA Icons
Generate all required PWA icons from your logo:
Step 4: Validate Setup
Validate your PWA configuration:
โก Quick Start
Method 1: Fluent API (Recommended)
Register the plugin in your Panel provider with fluent configuration:
Method 2: Configuration File
Alternatively, register the plugin and configure via config file:
Then configure in config/filament-pwa.php
:
Method 3: Dynamic Configuration with Closures
For advanced use cases, use closures for dynamic configuration:
๐ง Configuration
The plugin offers extensive configuration options through multiple approaches:
Core Configuration Options
Option | Type | Default | Description |
---|---|---|---|
name |
string\|Closure |
config('app.name') . ' Admin' |
PWA application name |
short_name |
string\|Closure |
'Admin' |
Short name for home screen |
description |
string\|Closure |
'Admin panel for ' . config('app.name') |
App description |
start_url |
string\|Closure |
'/admin' |
Starting URL when app opens |
display |
string |
'standalone' |
Display mode (standalone , fullscreen , minimal-ui , browser ) |
theme_color |
string\|Closure |
Auto-detected from Filament | Theme color for browser UI |
background_color |
string\|Closure |
'#ffffff' |
Background color during loading |
orientation |
string |
'portrait-primary' |
Screen orientation preference |
scope |
string |
'/admin' |
Navigation scope |
lang |
string\|Closure |
Auto-detected from Laravel | Language code |
dir |
string\|Closure |
Auto-detected from language | Text direction (ltr , rtl ) |
Installation Configuration
Icon Configuration
Service Worker Configuration
๐ Internationalization
The plugin includes comprehensive internationalization support with built-in translations for 10+ languages and full RTL/LTR support.
Supported Languages
Language | Code | Direction | Status |
---|---|---|---|
English | en |
LTR | โ Complete |
Arabic | ar |
RTL | โ Complete |
Spanish | es |
LTR | โ Complete |
French | fr |
LTR | โ Complete |
German | de |
LTR | โ Complete |
Portuguese | pt |
LTR | โ Complete |
Italian | it |
LTR | โ Complete |
Russian | ru |
LTR | โ Complete |
Japanese | ja |
LTR | โ Complete |
Chinese (Simplified) | zh-CN |
LTR | โ Complete |
Dutch | nl |
LTR | โ Complete |
Language Configuration
Automatic Detection (Recommended)
The plugin automatically detects language and text direction from Laravel's configuration:
Manual Configuration
Dynamic Language Configuration
RTL Language Support
For RTL languages like Arabic, the plugin automatically:
- Sets
dir="rtl"
in the PWA manifest - Provides culturally appropriate translations
- Handles text direction in installation prompts
- Supports RTL-aware UI components
Custom Translations
To add custom translations or modify existing ones:
-
Publish the language files:
-
Modify translations in
resources/lang/{locale}/pwa.php
: - Add new language support:
Translation Keys Reference
The plugin uses the following translation keys:
๐จ Icon Generation
The plugin automatically generates all required PWA icons from a single source image with high-quality output and maskable icon support.
Supported Source Formats
- SVG (Recommended) - Vector format provides the best quality at all sizes
- PNG - High-resolution raster images (minimum 512x512 recommended)
- JPG - Supported but PNG recommended for transparency
Basic Icon Generation
Generated Icon Sizes
The plugin generates icons in the following sizes by default:
- Standard Icons: 72x72, 96x96, 128x128, 144x144, 152x152, 192x192, 384x384, 512x512
- Maskable Icons: 192x192, 512x512 (with safe area padding)
- Favicon: 32x32 (saved as favicon.ico)
Maskable Icons
Maskable icons ensure your app icon looks great on all devices by providing a safe area:
Maskable icons are automatically generated with:
- 80% safe area for the actual icon
- 20% padding around the edges
- Theme color background
Advanced Icon Configuration
Image Processing Requirements
The plugin uses different image processing libraries based on availability:
- Imagick (Recommended) - Best quality, supports SVG natively
- GD Extension - Fallback option, limited SVG support
- Intervention Image - Enhanced image processing capabilities
Install Imagick for best results:
Troubleshooting Icon Generation
Source image not found:
Poor quality icons:
- Use SVG source for best quality
- Ensure PNG source is at least 512x512 pixels
- Install Imagick extension for better processing
Permission errors:
Manual Icon Placement
If you prefer to create icons manually, place them in the configured icons directory:
๐ Advanced Features
Debug Mode
Enable debug mode to always show installation prompts during development:
Custom Service Worker
Extend the service worker functionality:
App Shortcuts
Add shortcuts that appear when users long-press your app icon:
HTTPS Requirements
PWAs require HTTPS in production. The plugin validates this automatically:
For development, you can use:
- Laravel Valet (automatic HTTPS)
php artisan serve
with--host=localhost
(localhost is exempt from HTTPS requirement)- ngrok for testing on mobile devices
Performance Optimization
The plugin includes several performance optimizations:
๐จ Automatic Color Detection
The plugin automatically detects and uses your Filament panel's primary color for the PWA installation banner and other UI elements. The color detection system works with both Filament v3 and v4:
Detection Priority
- Current Panel Context - Colors from the active panel (highest priority)
- Runtime Panel Detection - Detected from current route/request context
- Admin Panel - Default admin panel colors
- Any Available Panel - First available panel colors
- Configuration Files - Filament config file colors
- Fallback Color -
#6366f1
(Tailwind Indigo 500)
Supported Color Formats
The system handles various color formats used by Filament:
Manual Override
You can override the automatic detection:
๐ง Troubleshooting
Common Issues
Installation prompt not showing:
Icons not loading:
Service worker not updating:
PWA banner styling broken in Filament v4:
Validation shows "Manifest file not found" or "Service worker not found":
PWA not installable:
Validation Command
Use the validation command to check your PWA setup:
This checks for:
- Manifest route registration and accessibility
- Service worker route registration and accessibility
- Required icons (192x192, 512x512)
- HTTPS in production
Note: The plugin serves manifest.json and sw.js dynamically through routes, not as physical files. The validation has been updated to check route registration instead of file existence.
Debug Information
Get detailed debug information about color detection and configuration:
The debug output includes:
- Current panel detection and colors
- All available panels and their color configurations
- Color extraction steps and results
- Final resolved theme color
- Configuration sources and priorities
Browser Developer Tools
Use browser developer tools to debug PWA issues:
- Chrome DevTools > Application > Manifest - Check manifest configuration
- Application > Service Workers - Monitor service worker status
- Application > Storage - Check cached resources
- Console - Look for PWA-related errors
๐ API Reference
FilamentPwaPlugin Methods
Basic Configuration
Display & Orientation
Internationalization
Installation & Features
Icons & Service Worker
PwaService Methods
๐ Documentation
- Configuration Guide - Complete configuration reference
- Configuration Migration - Upgrade from old versions
- Installation Guide - Detailed installation instructions
- Icon Generation - PWA icon generation guide
- Customization - Advanced customization options
- Troubleshooting - Common issues and solutions
๐งช Testing
๐ค Contributing
We welcome contributions! Please see CONTRIBUTING for details on:
- Reporting bugs
- Suggesting new features
- Submitting pull requests
- Adding new language translations
- Improving documentation
Adding New Language Support
To add support for a new language:
-
Copy the English translation file:
-
Translate all strings while preserving:
- Array structure and keys
- Placeholder variables (like
:attribute
) - Technical terms appropriately
-
Test the translations in your application
- Submit a pull request with your translation
๐ Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
๐ Changelog
Please see CHANGELOG for more information on what has changed recently.
๐ฅ Credits
- Ayman Alareqi - Creator and maintainer
- All Contributors - Thank you for your contributions!
Translation Contributors
- Arabic: Native speaker translations with RTL support
- Spanish: Community contributed
- French: Community contributed
- German: Community contributed
- Portuguese: Community contributed
- Italian: Community contributed
- Russian: Community contributed
- Japanese: Community contributed
- Chinese (Simplified): Community contributed
- Dutch: Community contributed
๐ License
The MIT License (MIT). Please see License File for more information.
All versions of filament-pwa with dependencies
filament/filament Version ^3.0|^4.0
illuminate/contracts Version ^10.0|^11.0|^12.0
spatie/laravel-package-tools Version ^1.15.0