Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Themer Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Commands Reference

Laravel Themer provides a comprehensive suite of Artisan commands for theme management.

Theme Management

theme:make

Create a new theme with complete directory structure.

php artisan theme:make {name} [options]

Arguments:

  • name - The name of the theme (e.g., "MyTheme")

Options:

  • --parent= - Optional parent theme for inheritance
  • --description= - Theme description
  • --author= - Theme author name
  • --tags= - Comma-separated tags
  • --provider - Generate a namespaced ThemeServiceProvider

Examples:

# Basic theme
php artisan theme:make Portfolio

# Theme with metadata
php artisan theme:make Portfolio \
  --description="Professional portfolio theme" \
  --author="John Doe" \
  --tags="portfolio,modern,responsive"

# Theme with parent and provider
php artisan theme:make PortfolioDark \
  --parent=portfolio \
  --provider

theme:activate

Activate a theme and update the .env file.

php artisan theme:activate {theme?} [options]

Arguments:

  • theme - Theme name or slug (optional, will prompt if not provided)

Options:

  • --no-interaction - Skip confirmation prompts

Examples:

# Direct activation
php artisan theme:activate portfolio

Previewing Themes

Before activating a theme globally, you can preview it securely by appending the ?preview_theme=slug parameter to any URL in your application. This is handled by the PreviewTheme middleware:

  1. In local environments (APP_ENV=local): Appending ?preview_theme=my-theme works instantly.
  2. In production: It requires a valid Signed Route URL unless themer.preview.enabled is explicitly set to true in your configuration.

theme:list

List all discovered themes with their metadata.

php artisan theme:list

Output includes:

  • Theme name and slug
  • Version
  • Parent theme (if any)
  • Author
  • Tags
  • Removable/Disableable flags

theme:info

Display detailed diagnostic information about a specific theme.

php artisan theme:info {theme?}

Arguments:

  • theme - Theme name or slug (optional, uses active theme if not provided)

Displays:

  • Basic Info: Name, Slug, Version, Author, and Path.
  • Resource Detection: Presence of Views, Translations, Service Provider, and Livewire components.
  • Inheritance: Full parent chain and immediate parent.
  • Assets: Vite configuration status and custom asset paths.

[@theme_asset](https://github.com/theme_asset)

Generate a public URL for a theme asset.

<link rel="stylesheet" href="[@theme_asset](https://github.com/theme_asset)('css/app.css')">

[@theme_vite](https://github.com/theme_vite)

Load theme-specific assets using Vite with proper hot-reload support.

[@theme_vite](https://github.com/theme_vite)('resources/assets/js/app.js')

theme:delete

Delete a theme from the filesystem.

php artisan theme:delete {theme} [options]

Arguments:

  • theme - Theme name or slug

Options:

  • --force - Skip confirmation prompt

Examples:

# Interactive deletion
php artisan theme:delete portfolio

# Force deletion
php artisan theme:delete portfolio --force

Note: Only themes marked as removable: true in theme.json can be deleted without --force.


theme:clone

Clone an existing theme to create a new one.

php artisan theme:clone {source} {destination}

Arguments:

  • source - Source theme name or slug
  • destination - New theme name

Example:

php artisan theme:clone portfolio portfolio-dark

This creates a complete copy with updated metadata.


Asset Management

theme:publish

Publish theme assets to the public directory.

php artisan theme:publish {theme?}

Arguments:

  • theme - Theme name or slug (optional, publishes all if not provided)

Examples:

# Publish all themes
php artisan theme:publish

# Publish specific theme
php artisan theme:publish portfolio

theme:dev

Start Vite development server for a theme.

php artisan theme:dev {theme}

Arguments:

  • theme - Theme name or slug (optional, auto-detects active theme if omitted)

Example:

# Start dev server for specific theme
php artisan theme:dev portfolio

# Start dev server for the currently active theme automatically
php artisan theme:dev

This runs npm run dev in the theme's directory with hot module replacement.


theme:build

Build production assets for a theme.

php artisan theme:build {theme}

Arguments:

  • theme - Theme name or slug

Example:

php artisan theme:build portfolio

This runs npm run build to compile optimized production assets.


theme:npm

Run NPM commands in a theme's context.

php artisan theme:npm {theme} {command}

Arguments:

  • theme - Theme name or slug
  • command - NPM command to run

Examples:

# Install dependencies
php artisan theme:npm portfolio install

# Add a package
php artisan theme:npm portfolio "add alpinejs"

# Run custom script
php artisan theme:npm portfolio "run custom-script"

Maintenance

theme:lint

Lint and automatically format a specific theme's PHP code (using Laravel Pint) and frontend assets (using NPM format or lint scripts).

php artisan theme:lint {theme?} [options]

Arguments:

  • theme - Theme name or slug (optional, uses active theme if not provided)

Options:

  • --php - Only lint PHP files
  • --assets - Only lint frontend JS/CSS assets

Examples:

# Lint both PHP and assets for the active theme
php artisan theme:lint

# Lint specific theme
php artisan theme:lint portfolio

# Only run Laravel Pint on the theme's PHP files
php artisan theme:lint portfolio --php

theme:cache

Cache theme discovery for production performance.

php artisan theme:cache

This creates a cache file at bootstrap/cache/themes.php containing all discovered themes.


theme:clear

Clear the theme discovery cache.

php artisan theme:clear

Use this after adding, removing, or modifying themes during development.


theme:check

Validate theme structure and dependencies.

php artisan theme:check {theme?}

Arguments:

  • theme - Theme name or slug (optional, checks all if not provided)

Checks:

  • Theme hierarchy integrity
  • Circular dependency detection
  • Missing parent themes
  • Asset health
  • Missing screenshots
  • Required module dependencies (if using laravel-modular)

Example:

php artisan theme:check portfolio

theme:upgrade

Upgrade themes to the latest asset structure.

php artisan theme:upgrade {theme?}

Arguments:

  • theme - Theme name or slug (optional, upgrades all if not provided)

What it does:

  • Migrates old asset structures
  • Updates package.json and vite.config.js
  • Runs themer:install to configure NPM workspaces

Installation

themer:install

Install and configure Laravel Themer.

php artisan themer:install

What it does:

  • Publishes config/themer.php
  • Creates themes/ directory
  • Configures NPM Workspaces in root package.json
  • Sets up Vite integration

Laravel Command Overrides

Laravel Themer extends standard Laravel and Livewire commands to be theme-aware.

make:livewire

Create Livewire components in a theme.

php artisan make:livewire {name} --theme={theme}

Example:

php artisan make:livewire home --class --theme=portfolio

Creates:

  • themes/portfolio/app/Livewire/Home.php
  • themes/portfolio/resources/views/livewire/home.blade.php

livewire:layout

Create a Livewire layout in a theme.

php artisan livewire:layout --theme={theme}

Example:

php artisan livewire:layout --theme=portfolio

Creates themes/portfolio/resources/views/layouts/app.blade.php.


make:component

Create Blade components in a theme.

php artisan make:component {name} --theme={theme}

Example:

php artisan make:component button --theme=portfolio

make:view

Create views in a theme.

php artisan make:view {name} --theme={theme}

Example:

php artisan make:view welcome --theme=portfolio

Next Steps

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
codifyo/ts-generator-bundle
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor