Livewire and Domain Driven Development

Hi everyone,

I’m farily new to Livewire, and I want to use it for my nex project. Also, and because it will be pretty big, I want to code it based on Domain Driven Development.
So I would like to move Livewire components into each appropriate folder, to keep everything neat and tidy.
And when I do, I got the following error message:

The "app/Http/Livewire" directory does not exist.

That makes sense, because I moved my components from this folder.

But how can I load Livewire components from multiple folders?

Thank you!

Hi! What’s stopping you from sharing the logic inside the Livewire folder/ ?

With Livewire, it is difficult to comply with DDD

Specifically, I share these (this is sample):

LiveWire

- Admin
– Product
— Create
— Read
— Update
— Delete
– Catalog
– Category
– Advantage
– User
– Contribute

Otherwise, you will have to redefine the root folder of Livewire, but the most important question is: “Why does the goat need an accordion?” - just kidding

Hey, @DimZ

I’m afraid with this logic Livewire not work with you.

Meaning, after publishing the config and assets of livewire you can visit livewire.php in config folder, and you will notice that you can define the class map

    'class_namespace' => 'App\\Http\\Livewire',

By default, it’s located in App\Http\Livewire but you can change the class map here.

For example:
image

And inside livewire you can manage your modules/models as you want.

If you want to change the location of some components and the other don’t. You can take a look here and learn how to register a custom component (If you want to add a service provider in each module for example)