This guide will walk you through installing and setting up the Filament PWA plugin.
composer require alareqi/filament-pwa
Publish the configuration file to customize PWA settings:
php artisan vendor:publish --tag="filament-pwa-config"
This will create a config/filament-pwa.php file where you can customize all PWA settings.
Add the plugin to your Filament Panel provider:
<?php
namespace App\Providers\Filament;
use Alareqi\FilamentPwa\FilamentPwaPlugin;
use Filament\Panel;
use Filament\PanelProvider;
class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
// ... other configuration
->plugin(FilamentPwaPlugin::make());
}
}
If you want to customize the PWA views or assets:
# Publish views for customization
php artisan vendor:publish --tag="filament-pwa-views"
# Publish assets
php artisan vendor:publish --tag="filament-pwa-assets"
Generate all required PWA icons from your logo:
# Using SVG (recommended for best quality)
php artisan filament-pwa:setup --generate-icons --source=public/logo.svg
# Using PNG
php artisan filament-pwa:setup --generate-icons --source=public/logo.png
Verify your PWA setup is correct:
php artisan filament-pwa:setup --validate
You can also use the all-in-one setup command:
php artisan filament-pwa:setup --publish-assets --generate-icons --source=public/logo.svg --validate
Add these environment variables to your .env file for easy configuration:
# PWA Configuration
PWA_APP_NAME="${APP_NAME} Admin"
PWA_SHORT_NAME="Admin"
PWA_DESCRIPTION="Admin panel for ${APP_NAME}"
PWA_START_URL="/admin"
PWA_THEME_COLOR="#A77B56"
PWA_BACKGROUND_COLOR="#ffffff"
PWA_LANG="en"
PWA_DIR="ltr"
# Installation Prompts
PWA_INSTALLATION_PROMPTS=true
PWA_INSTALLATION_DELAY=2000
PWA_IOS_INSTRUCTIONS_DELAY=5000
# Service Worker
PWA_CACHE_NAME="filament-admin-v1.0.0"
PWA_OFFLINE_URL="/offline"
# Icons
PWA_ICON_SOURCE="icon.svg"
PWAs require HTTPS in production. Make sure your application is served over HTTPS when deployed.
For local development, you can use tools like:
After installation, you should see:
Visit your admin panel and check the browser's developer tools to verify:
How can I help you explore Laravel packages today?