jcmccoders/laratheme
Laratheme adds multi-theme support to Laravel 11/12: switch active theme via config/env, auto-register view namespaces, generate new themes with make:theme, and resolve theme views and public assets (CSS/JS/images) from dedicated theme folders.
resource_path(), public_path()) and PHP 8.2+, ensuring alignment with current best practices.make:theme command abstracts boilerplate setup, accelerating onboarding.config/theme.php allows easy theme switching without hardcoding paths.THEME_ASSETS_PATH.php artisan view:clear triggers).active theme is user-controlled)?make:theme to scaffold a secondary theme and validate view/asset resolution.themes/ directory, updating build tools (if used).php artisan vendor:publish --tag=theme-config) and customize THEME_ACTIVE via .env.config/theme.php (e.g., custom paths for views/assets).THEME_ASSETS_PATH must be updated in tailwind.config.js.view:clear is triggered post-theme switch (e.g., via event listeners).THEME_ACTIVE.php artisan make:theme default).themes/ directory reduces merge conflicts.THEME_ASSETS_PATH if build tools change.THEME_ACTIVE and paths in middleware to diagnose switching issues.php artisan view:clear if themes fail to render.THEME_ASSETS_PATH should be globally cached (e.g., via Cloudflare).| Failure Scenario | Impact | Mitigation |
|---|---|---|
Invalid THEME_ACTIVE value |
Broken UI/500 errors | Validate theme names in middleware. |
| Missing theme views/assets | Partial renders/404s | Fallback to default theme or graceful degradation. |
| Asset path conflicts | CSS/JS not loading | Use absolute paths or alias assets in public/. |
| Caching conflicts | Stale theme views | Implement cache tags or view:clear triggers. |
| PHP version incompatibility | Package fails to load | Pin PHP 8.2+ in composer.json. |
composer require, make:theme) takes <30 mins.resources/themes/{name}/views/).php artisan view:clear to deploy scripts if themes change.How can I help you explore Laravel packages today?