wowpack / structured-livewire-components
Structure livewire components in a more organized way.
Requires
- php: ^8.0
- laravel/framework: ^10.0 || ^11.0 ||^12.0
- livewire/livewire: ^3.0
This package is auto-updated.
Last update: 2025-06-29 08:48:46 UTC
README
A Laravel package to structure Livewire components in a more organized way.
Installation
Require the package via Composer:
composer require wowpack/structured-livewire-components
Configuration
Publish the configuration file using the following Artisan command:
php artisan vendor:publish --provider="Wowpack\StructuredLivewire\StructuredLivewireServiceProvider" --tag=config
This will publish the structured-livewire.php
config file to your application's config
directory.
Configuration Options
The configuration file contains the following options:
livewire-components-directory
: The base directory where Livewire components are stored. Default isapp/Livewire
.groups
: Define groups of components with their locations and suffixes.
Example:
return [ 'livewire-components-directory' => app_path('Livewire'), 'groups' => [ 'pages' => [ 'location' => 'Components', 'suffix' => 'components', ], 'components' => [ 'location' => 'Components', 'suffix' => 'components', ], ] ];
Usage
The package automatically registers Livewire components based on the configuration.
You can create structured Livewire components using the provided Artisan command:
php artisan livewire:structured-livewire-component {component-name}
You will be prompted to select the group for the component.
Compatibility
This package supports Laravel versions 10, 11, and 12, and Livewire version 3.
License
MIT License