26b / laravel-dynamic-panels
Laravel package to create dynamic panels
Installs: 1 376
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^8.0
- spatie/laravel-package-tools: ^1.14
Requires (Dev)
- orchestra/testbench: ^8.0
This package is auto-updated.
Last update: 2024-11-09 13:25:34 UTC
README
Provides an area on your website to display panels dynamically.
Currently supports:
- Random panel loading.
- Manual panel changing.
- Timer based panel changing.
Requires:
- Livewire
- AlpineJS
Getting started
Require the package
composer require 26b/laravel-dynamic-panels
Usage
Create as many livewire components as you want, where you overload the method getPanels()
with a list of the panels you want to display.
namespace App\Livewire\DynamicPanels; use TwentySixB\LaravelDynamicPanels\Livewire\PanelContainer; class Container extends PanelContainer { /** * @inheritDoc * * @return array */ public function getPanels() : array { return [ 'livewire:profile-completion-panel', 'did-you-know', 'app-install', ]; } }
Next, on your blade view, call the livewire component.
<livewire:dynamic-panels.container />
Customizing
Publish the configuration file should you need to customise it.
php artisan vendor:publish --tag=dynamic-panels-views