You can use Laravel as an API. Use it as a back end, and create an ordinary React front end that authenticates using JWTs or similar, whatever the mobile app is using. But why not use Inertiajs and React + Breeze, if you separate the routes entirely? Keep the API in /routes/api.php, and have a new front end with routes in routes/web.php. Keep everything separate and versioned for your API, let the mobile app keep using it, and use whatever you like for a new front end responding to routes in web.php. You can use a single repository if you want, I assume you're talking about a monorepo?
Using Laravel with React
Hi everyone, newbie here.
I just want to ask how I can integrate the two technologies mentioned above into an existing project. I’ve recently joined a very legacy project that used Laravel 5.5 as a semi-backend, along with a pseudo-frontend written in Smarty, which also functions as a backend itself. Yes, it’s a very disorganized project.
Recently, we’ve accomplished some major upgrades to reorganize the project, we're now in Laravel 11, but now we’re facing a dilemma: whether to use Blade/Livewire views or React. We're oriented towards using React because of the benefits of JavaScript but here’s the catch: we cannot use the Laravel Breeze + React approach because we have a mobile app, and as far as I know, that setup requires using Inertia, which doesn’t use APIs—a must for us due to the app.
I have no experience with JS frameworks and just wanted to know how I can address this problem. Specifically, how can I “glue” Laravel and React together? Additionally, is it possible to use a single repository for both the backend and frontend, instead of having separate repositories for each?.
Thanks in advance, and I apologize if my question breaks any forum rules.
Please or to participate in this conversation.