New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

26b/laravel-dynamic-panels

Laravel package to create dynamic panels
2,120
Install
composer require 26b/laravel-dynamic-panels:dev-main
PHP:^8.0
License:MIT
Last Updated:Jan 9, 2024
Links: GitHub  ·  Packagist
Maintainer: csrui

Laravel Dynamic Panels

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

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

660,512,042 9,702
laravel/framework

The Laravel Framework.

625,568,548 34,998
laravel/tinker

Powerful REPL for the Laravel framework.

531,591,559 7,442
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

450,320,528 608
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

424,642,029 4,662