Skip to content

wowpack/structured-livewire-components

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Structured Livewire Components

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 is app/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

About

Structure livewire components in a more organized way.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages