alizharb/laravel-themer
Enterprise-grade theme management for Laravel. Create, clone, activate, and safely delete themes with per-theme Vite builds, NPM workspaces, asset shortcuts, view overrides, and Livewire 4 support. Includes metadata, wizards, and fast production caching.
Laravel Themer is a robust, enterprise-grade theme management package for Laravel applications. It provides a seamless way to manage themes, including asset publishing, view overrides, Livewire 4 integration, and modular support. Designed for modern TALL stack applications, it simplifies the creation of multi-themed applications without the complexity.
package.json and vite.config.js for total asset isolation.theme:dev and theme:build.--theme support.laravel/prompts.screenshots, tags, and management flags (removable, disableable) in theme.json.theme.json for easier dependency mapping.Themer::forTheme().middleware('theme:name').laravel-modular including dependency verification in theme:check.theme:doctor, theme:status, theme:debug, theme:graph, and theme:why expose theme health for teams and CI.theme:preview.theme.json and expose them with theme_token(), theme:tokens, and @themeTokens.make, npm, dev, build, clone, delete, list, check, cache, lint) to natively manage themes.For full documentation, please visit alizharb.github.io/laravel-themer or browse the docs/ directory.
For copy-ready release notes, see RELEASE_NOTES_1.4.0.md.
Install the package via Composer:
composer require alizharb/laravel-themer
Run the installation command to automatically set up Laravel Themer:
php artisan themer:install
This interactive command will:
config/themer.php)themes/)vite.config.js with the themerLoader for automatic theme asset bundlingIf you prefer manual setup or need more control, see the Installation Guide for detailed instructions on:
Laravel Themer is part of a comprehensive modular ecosystem for Laravel applications:
| Package | Description |
|---|---|
| laravel-modular | Framework-agnostic modular architecture with zero-config autoloading and 29+ Artisan command overrides. Required for modular theme discovery. |
| laravel-modular-livewire | Official Livewire 4 bridge providing automatic component discovery and registration within modules. |
| laravel-modular-filament | Official Filament v5 bridge enabling admin panel integration with automatic resource discovery in modules. |
| laravel-hooks | Universal extensibility and plugin system for Laravel 12+ applications with WordPress-style hooks and filters. |
| filament-themer-luncher | A comprehensive Filament v5 interface for managing, switching, and backing up themes. |
| filament-modular-luncher | A powerful Filament v5 manager for listing, toggling, and managing system modules. |
These packages work seamlessly together to provide a complete modular development experience.
Generate a new theme with a standard directory structure:
php artisan theme:make "Dark Theme"
Install packages into a theme workspace directly from the root:
php artisan theme:npm --theme=dark-theme install lodash
Launch a dedicated Vite dev server for your theme:
php artisan theme:dev --theme=dark-theme
Safe and fast lifecycle management:
# Duplicate an existing theme
php artisan theme:clone "Summer Edition" --theme=dark-theme
# Safe removal (respects 'removable' flag)
php artisan theme:delete --theme=summer-edition
Switch the active theme globally:
php artisan theme:activate dark-theme
Inspect and validate your theme system:
php artisan theme:doctor
php artisan theme:status
php artisan theme:debug dark-theme --json
php artisan theme:graph
php artisan theme:why dark-theme
Generate a preview URL for an inactive theme:
php artisan theme:preview dark-theme --signed --expires=30
Expose theme-specific brand tokens:
php artisan theme:tokens dark-theme --css
@themeTokens
The package automatically registers Livewire components within your theme.
php artisan make:livewire Header --theme=dark-theme
We strictly enforce testing. Use the provided test suite to verify your themes:
vendor/bin/pest
We would like to extend our thanks to the following sponsors for funding Laravel Themer development. If you are interested in becoming a sponsor, please visit the Laravel Themer GitHub Sponsors page.
We welcome contributions! Please see CONTRIBUTING for details.
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)If you discover any security-related issues, please email Ali Harb at harbzali@gmail.com.
The MIT License (MIT). Please see License File for more information.
How can I help you explore Laravel packages today?