Pixelairport's avatar

2 Laravel with 1 Database

Hi, I need some feedback. I had just a discussion with my team to change the whole structure of our project. We have a laravel with nova in it and it is an application (where people can do something, with dashboard, projects, ...) and some normal pages like about us, imprint, ...

Now one person said, it would be good to have two laravel, which use the same db. For example if we have a new designer, he can only push his code to one repo and can not do anything in the business logic (other repo). Or if a SEO agency wants to push code to the website, they can do it without break anything. Or SEO agency wants to do scheme html code for better SEO.

My position was: For SEO agencies who want to push scripts, we use google tag manager. To split design we can do namespaces for themes (and maybe components) and the designer only get permissions to push this design folder to our github account.

I wanted to ask what you prefer and how you build websites like this? Did you ever had two laravels and one database? I see the problem that you also need to sync models, you have to have controllers which need actions from the other laravel, ... Am I wrong? What would you say?

Maybe for the reasons the person said we had to build an API, what would be the better solution. This would be a big todo, but the normal way. Then the designer (for app, website, ... maybe other) can use whatever they want (other than laravel) and get data from API.

0 likes
2 replies
martinbean's avatar

@pixelairport Two Laravel applications just sounds like unnecessary complication.

So long as you have permissions on your repository so that code has to be submitted as pull requests then it will be impossible for people to push code to directories or files they shouldn’t.

1 like
Pixelairport's avatar

@martinbean Thx. Yes I mean with pull/push subdirectories like the backend team have access to everything. The designer only get a copy of the repo and the theme directory is also loaded via composer from github. So we can give him the possibility to do that. But I agree with you ... thats all really complicated. I just talk to the other person and we said that it really would be better to create a normal API, that the frontend team can choose the tools they want and we can give them access to the things they need. I think that is the best way... isnt it?

PS: Also it makes no sense for me to load a whole laravel, if the team only wants to make the frontend.

Please or to participate in this conversation.