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

Lara Pro Demo Theme Laravel Package

appdezign/lara-pro-demo-theme

Demo theme for Lara Pro CMS 10, built on Laravel. A child theme of the Base Theme, showcasing Lara CMS styling and structure for development and customization. Developer guide: https://docs.laracms.nl/

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Steps to First Use

  1. Prerequisites:

    • Install Lara CMS 10 (this theme is a child theme and requires the base CMS).
    • Laravel 10+, PHP 8.1+, Node.js (for Tailwind).
    • Composer and Git.
  2. Installation:

    composer require appdezign/lara-pro-demo-theme
    
    • Publish the theme assets and config:
      php artisan vendor:publish --provider="Appdezign\LaraProDemoTheme\ThemeServiceProvider" --tag="public"
      php artisan vendor:publish --provider="Appdezign\LaraProDemoTheme\ThemeServiceProvider" --tag="config"
      
  3. Enable the Theme:

    • Set the theme in config/cms.php:
      'theme' => 'lara-pro-demo-theme',
      
    • Run migrations (if Lara CMS isn’t already set up):
      php artisan migrate
      
  4. First Demo Setup:

    • Seed the CMS with demo content (if available):
      php artisan db:seed --class=LaraProDemoThemeSeeder
      
    • Start the dev server:
      php artisan serve
      
    • Access the demo at http://localhost:8000.
  5. Where to Look First:

    • Theme Structure: Explore resources/views in the theme’s vendor directory for Blade templates.
    • Tailwind Config: Check resources/css/app.css for customizations.
    • Lara CMS Docs: Refer to laracms.nl for CMS-specific features like content types, media management, and admin panels.

Implementation Patterns

Usage Patterns

  1. Child Theme Overrides:

    • Extend the theme by creating a custom child theme in your project’s resources/themes/your-theme.
    • Override Blade templates (e.g., resources/views/layouts/app.blade.php) or assets (e.g., resources/css/your-theme.css).
    • Example structure:
      resources/themes/your-theme/
      ├── assets/
      │   ├── css/
      │   └── js/
      ├── views/
      │   ├── layouts/
      │   └── partials/
      └── config/
      
  2. Dynamic Content via Lara CMS:

    • Use Lara CMS’s content types (e.g., Page, Post) to manage demo content dynamically.
    • Fetch content in Blade templates:
      @foreach(\App\Models\Page::where('template', 'demo-home')->get() as $page)
          {{ $page->content }}
      @endforeach
      
    • Leverage Livewire components (Filament 5) for interactive demos.
  3. Asset Customization:

    • Compile Tailwind CSS with your customizations:
      npm run dev
      
    • Override default assets by publishing them:
      php artisan vendor:publish --tag=lara-pro-demo-theme-public
      
  4. Multi-Language Support:

    • Enable Lara CMS’s localization features and translate content via the admin panel.
    • Use Blade’s @lang directive or Laravel’s trans() helper.
  5. Demo Data Management:

    • Seed demo content programmatically:
      // In a custom seeder
      \App\Models\Page::create([
          'title' => 'Demo Home',
          'template' => 'demo-home',
          'content' => '<h1>Welcome to our demo!</h1>',
      ]);
      
    • Use the Lara CMS admin panel to manually update content.

Workflows

  1. Rapid Prototyping:

    • Step 1: Install the theme and enable it.
    • Step 2: Seed demo content or populate via the admin panel.
    • Step 3: Customize templates/assets for your use case.
    • Step 4: Deploy to a staging environment for testing.
  2. Client-Specific Demos:

    • Step 1: Create a child theme for each client.
    • Step 2: Override assets (e.g., resources/css/client-branding.css) to inject logos/colors.
    • Step 3: Use Lara CMS’s content replication to duplicate demo data per client.
    • Step 4: Deploy to isolated subdomains (e.g., client1-demo.yoursite.com).
  3. Internal Tooling:

    • Step 1: Disable unused CMS features (e.g., admin panel) for security.
    • Step 2: Integrate with internal APIs via Lara CMS’s custom fields or event listeners.
    • Step 3: Use Livewire for real-time interactions (e.g., form submissions).

Integration Tips

  1. Laravel Ecosystem:

    • Integrate with Laravel Scout for search functionality in demos.
    • Use Laravel Horizon to queue demo content updates.
    • Extend with Laravel Nova or Filament for admin customizations.
  2. Third-Party Services:

    • Connect to Stripe or PayPal for demo e-commerce via Lara CMS’s payment gateways.
    • Embed Google Analytics or Hotjar in the theme’s app.blade.php.
  3. CI/CD:

    • Automate demo deployments using GitHub Actions or Laravel Forge.
    • Example workflow:
      # .github/workflows/deploy-demo.yml
      name: Deploy Demo
      on:
        push:
          branches: [ demo ]
      jobs:
        deploy:
          runs-on: ubuntu-latest
          steps:
            - uses: actions/checkout@v4
            - uses: shivammathur/setup-php@v2
            - run: composer install
            - run: npm install && npm run build
            - run: php artisan migrate --env=demo
            - run: php artisan demo:deploy  # Custom Artisan command
      
  4. Performance Optimization:

    • Enable Laravel’s cache (php artisan cache:clear) and opcache.
    • Use Tailwind’s JIT mode for faster builds:
      // tailwind.config.js
      module.exports = {
        mode: 'jit',
      }
      
    • Lazy-load non-critical assets:
      <img src="{{ asset('demo-image.jpg') }}" loading="lazy" alt="Demo">
      

Gotchas and Tips

Pitfalls

  1. Lara CMS Dependency:

    • Issue: The theme assumes Lara CMS is installed, which adds admin panels, ORM layers, and middleware you may not need.
    • Fix: Disable unused CMS features via config or middleware:
      // app/Http/Kernel.php
      protected $middleware = [
          // Disable Lara CMS middleware if not needed
          // \Appdezign\LaraCms\Http\Middleware\CheckForMaintenanceMode::class,
      ];
      
  2. Template Override Conflicts:

    • Issue: Child theme overrides may clash with Lara CMS’s core templates.
    • Fix: Use priority-based overrides (e.g., resources/views/vendor/lara-cms/overrides/) or consult the Lara CMS docs for safe hooks.
  3. Asset Compilation:

    • Issue: Tailwind or JS assets may fail to compile due to missing dependencies.
    • Fix: Ensure node_modules is installed and rebuild:
      npm install
      npm run dev
      
  4. Database Schema Mismatches:

    • Issue: Lara CMS’s migrations may conflict with existing tables.
    • Fix: Use a separate database for demos or manually adjust migrations.
  5. Livewire/Filament Updates:

    • Issue: The theme uses Filament 5/Livewire 4, which may require updates if your Laravel project uses older versions.
    • Fix: Align versions in composer.json or use package aliases.
  6. Caching Quirks:

    • Issue: Blade templates or CMS content may not update after changes.
    • Fix: Clear caches:
      php artisan view:clear
      php artisan cache:clear
      php artisan config:clear
      
  7. Tailwind Config Conflicts:

    • Issue: Custom Tailwind configs may override the theme’s defaults.
    • Fix: Extend the theme’s config:
      // tailwind.config.js
      module.exports = {
        presets: [require('lara-pro-demo-theme/tailwind.config')],
        content: [
          './resources/**/*.blade.php',
          './vendor/appdezign/lara-pro-demo-theme/resources/**/*.blade.php',
        ],
      }
      

Debugging

  1. Template Debugging:

    • Enable Blade debugging:
      // config/view.php
      'debug' => env('APP_DEBUG', true),
      
    • Use @dd() in Blade templates to inspect variables.
  2. **Lara

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.
calmfox/watch-sylius
damienfern/grpc-symfony-bundle
atoolo/index-bundle
atoolo/genai-bundle
coprotoai/laravel-ticket
davidjln/llm-carbon-bundle
cryonighter/valid-request-bundle
coolms/taxonomy-bundle
coolms/field-bundle
articulate-orm/symfony
aaix/laravel-tall-architect
ephoto/akeneo-connector
emmanuelballery/eb-plantumlbundle
emielburgman/symfony-visitor-beacon
emielburgman/symfony-visit-storage
emielburgman/symfony-security-headers
emielburgman/symfony-log-viewer
emarref/xdebug-bundle
emarref/pubnub-bundle
elriseio/finance-money-bundle