You're browsing the documentation for an old version of Livewire. Consider upgrading your project to Livewire 3.x.

Package Development

Registering Custom Components

You may manually register components using the Livewire::component method. This can be useful if you want to provide Livewire components from a composer package. Typically this should be done in the boot method of a service provider.

1class YourPackageServiceProvider extends ServiceProvider {
2 public function boot() {
3 Livewire::component('some-component', SomeComponent::class);
4 }

Now, applications with your package installed can consume your component in their views like so:

2 @livewire('some-component')
← Previous Topic Troubleshooting
Next Topic → Artisan Commands