infinety-es/temply-theme-manager

A Laravel Nova tool.

dev-master 2019-01-25 11:35 UTC

This package is auto-updated.

Last update: 2024-03-25 22:54:30 UTC


README

Instructions

  1. Install Package

    composer require infinety-es/temply-theme-manager
  2. Config temply.php should have this config:

    'model_theme'   => App\Theme::class, // Theme Model Class
    'model_palette' => App\Palette::class, // Palette Model Class
  3. User model should have this attributes:

    public function getCurrentThemeAttribute()
    {
        return \App\Theme::first();
    }
    
    public function getCurrentPaletteAttribute()
    {
        return \App\Palette::first();
    }
  4. Add a Listener in EventServiceProvider.php

    'Infinety\TemplyThemeManager\Events\ThemeActivated' => [
        'App\Listeners\YourListener',
    ],

There are two public properties: Theme and Palette. You can access through: $event->theme or $event->palette.