Adding custom functionality in HUB on order detail #1563
-
Hello once again community. How can we add custom logic in hub? Appreciate your help as ALWAYS! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
That is something solved by Filament, as it provides a lot more control of the UI. Filament is in v1 which is currently work in progress, but we hope to have an alpha release out soon. |
Beta Was this translation helpful? Give feedback.
-
Alright, for anyone who needs this information, I found out how to handle it. You can find the documentation for slots in Lunar 8 admin hub here: https://docs.lunarphp.io/admin-hub/extending.html#slots Steps to create a custom slot (in my case a courier slot): Create a class in Livewire folder (very important). At this time of writing, the documentation states to create the class here: App\Hub\Components\Slots. I added a new folder for a good folder Order structure so the final path for this class needs to be
Next, we have to create a view here My blade looks like this:
Next, we go to
After thise steps, we can create custom functionality using the livewire logic. For example, our blade file had a link with
The code above will update our order and add in the meta column this:
From here you can create any logic you want. For example you can add a condition to hide the anchor for generating the AWB if it's already generated. Once again, thank you developers for this awesome product. I'm 100% sure that this project will have great success once many people will find it and I also bet that anyone who needs a complete e-commerce boilerplate would pay for something like this! |
Beta Was this translation helpful? Give feedback.
Alright, for anyone who needs this information, I found out how to handle it.
Lunar offers a very nice method to extend the HUB.
In this case we will use extending slots. Since the team developing this awesome project is focusing on development, probably is less time investing in a complete documentation, but I suppose that's why we have the community here.
You can find the documentation for slots in Lunar 8 admin hub here: https://docs.lunarphp.io/admin-hub/extending.html#slots
Steps to create a custom slot (in my case a courier slot):
Create a class in Livewire folder (very important). At this time of writing, the documentation states to create the class here: App\Hub\Components\Slots. …