Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

beyond's avatar

How to deployseparate react app and laravel api back end?

I have a separate react frontend app and separate laravel api app. In development I connect them and everything works fine by server the react with npm start and laravel artisan: serve separately. But now I want to move to production, please how do I position the react build file and laravel file on the server panel to enable my react access the api route in laravel? Please I really need help with this and looking forward to hearing from you soon. Thanks in advance.

0 likes
3 replies
caleb65's avatar

You'll probably run

PHP artisan ui react And copy your react project files to the laravel app, then add a link to the main.js or app.js to the app.blade.php file

1 like
GTHell's avatar

You can just normally deploy your react and laravel to server and just setup the react env to point to your laravel?

Please or to participate in this conversation.