Download the PHP package hexters/wirehmvc without Composer
On this page you can find all versions of the php package hexters/wirehmvc. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hexters/wirehmvc
More information about hexters/wirehmvc
Files in hexters/wirehmvc
Package wirehmvc
Short Description Package for laravel and livewwire with HMVC convept
License MIT
Informations about the package wirehmvc
Livewire HMVC (Beta)
This package is a support package for the hexters/laramodule package specifically made to integrate hexters/laramodule with livewire version 3.
To install through Composer, by run the following command:
Installation
Autoloading
By default the module classes are not loaded automatically. You can autoload your modules using psr-4
. For example :
And make Modules
directory in your root project folder
Don't forget to run the commands below
Manually add LivewireHandleUpdateProvider
to the list of providers in the app.php
config file
Important notes
If you want to use the mount()
hook, make sure you run the parent::mount()
for the parent class, see the example below.
Create Module
Follow the command below to create a module, and select Livewire in preset option!
You can also do this with an existing module, but remember that. The route.php
file will be replaced by a new file.
Artisan
More complete commands can be seen at the link below.
Artisan Documentation
Layouting
You need a layout for your livewire component, you can use the default layout from livewire and you can also create one specifically for your module.
Default command from livewire
Custom for specific modules
Rendering components
Rendering components can only be done on components in the module folder, or you can see Modules\Blog\Http\Middleware\LivewireSetupBlogMiddleware
class. I assume the module name is Blog
!
In order for a component to be used in another module, you need to register it first, open the provider in each of your modules, see the example below.
Each declared component will be given a prefix according to the module name, so when calling it, you need to add a prefix in front of it, see the example below.