Comments & Discussion
Good evening, I started with Laraavel a few month ago to create a project with a private wine cellar (with a lot of ideas). I just read this article and made a short lifewire tutorial. Easy to use ! But I even love the ressource controllers from Laravel. So i wonder If it is possible to mix up different frameworks in one project (and is it "state of the art"). Maybe lifewire for the simple things and react for more use in complicated database actions and even use the ressource controllers. And is it possible to combine things like call a ressource controller from lifewire. But anyway , your website an courses are great and I feel lucky to take part of it !
Best regards, Stephan
Hey,
You can mix different ideas in a project, but probably not in the way you think. Here's why:
- You can definitely use Resource Controllers with Livewire - just make sure that your Livewire is a component inside the blade view.
- You can't call Resource Controller methods from Livewire page (remember, Page and Component work completely differently).
- You can mix React with Livewire, but if I'm being honest - usually that causes a lot of friction. So it's better to use one of them.
In a way, different tech stacks require different setup/workflows. And some basic things, like passing data, can become complicated if they are mixed together. You can of course, use components/properties to pass some data, but they have to be completely isolated. This means - Livewire has to know nothing about React and React has to know nothing about Livewire.
Hope that helps a little bit :)
ps. Mixing of various tools is okay if you really have to, but in general - that can lead to some serious issues down the road. As with everything - you have to know what you are doing to be confident ;)
Hi Povilas, the link to the repo returns a 404 :-/ Did the link change maybe?
BR from Austria, David
Sorry David, I forgot to make it PUBLIC. Fixed now! Thanks for the notice.