Can we use Laravel with next?

I have a couple of questions - Is it reasonable to use Laravel and Next together? - if yes, should we run both of them together and interact with each other on the same server? - If u have experience with next can please tell me if most of the time how is the backend is handled? (Next is full-stack so is it necessary to include the backend)
16 Replies
Piotrek
Piotrek3y ago
If you have to build a full stack app I would just use create-t3-app if possible. If you have really specific Laravel things you can use Next with it, why not? 😄
cje
cje3y ago
Next.js has a backend You can also choose to use it with any other backend The way Next interacts with any other backend is just the normal http requests
Zero
Zero3y ago
Depends on what you need your app to do
cje
cje3y ago
I love the Next backend especially with tRPC, but there are a lot of good reasons not to use it, depending on your needs
Zero
Zero3y ago
It also depends if your laravel backend is already written or not
cje
cje3y ago
Ecosystem, existing code, existing developer knowledge, etc
Zero
Zero3y ago
If it's an established app I would probably not migrate your app to NextJS backend unless you have specific reasons to do so but theres no harm in making API calls using NextJS for frontend. Definitely speak to team about this.
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Samyar
SamyarOP3y ago
Well, I want to use it next just becuz i think it's good, it's much cleaner to write code with it. and the reason i want to pick Laravel is that my backend is already written in laravel. I haven't started the project yet so I want to pick a good approach to start the project. i can start the project just like the old way and use pure React If u have any other suggestions about how to do the front part. I mean what's ur suggestion just React or Next included (or a better library) cool, so Next is still a better choice than just Rect?
Zero
Zero3y ago
Again it really depends on what you need in your frontend. There are so many great tools you can start using today for frontend. NextJS is one of them. Some other notable ones would be Vite or Astro But typically you want to spin up a react app using NextJS or Vite
cje
cje3y ago
if you want to do SSR, Next is probably the better choice (you can do it in React/Vite but it's a pain) if you don't want to do SSR, I'd base the decision on whether you want SPA style routing or "1 url = 1 page" style routing if you already have the entire backend, you should probably just use it
Zero
Zero3y ago
^
venus
venus3y ago
I'd like to hear your opinion. Would you use Next.js's backend for larger projects?
cje
cje3y ago
It depends! These “which thing is better” conversations are so dumb Know the strengths and weaknesses of the different options, then pick one, then stop worrying about it and build
venus
venus3y ago
Yeah I agree! But just wanted to hear if someone have ever used it for large scaled projects
alan
alan3y ago
To answer your title question, yes: https://github.com/vercel-community/php . I think it answers the rest of the questions there as well. I'm not a big fan of the "discussion" this question generated, which is just a lot of "it depends" and answering with their own questions that don't really move the needle. This is the answer you're looking for. Do with it what you will
GitHub
GitHub - vercel-community/php: 🐘 PHP Runtime for ▲ Vercel Serverles...
🐘 PHP Runtime for ▲ Vercel Serverless Functions. Contribute to vercel-community/php development by creating an account on GitHub.
Want results from more Discord servers?
Add your server