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

Caseybrinegar's avatar

React.js with php?

I was wondering if any1 has any good sources of how to use php and react together? or any tutorials on how the file structure works together with front end and backend.

0 likes
2 replies
ejdelmonico's avatar
Level 53

Just run php artisan preset react on a new project and you are ready to go. Basically, use the resources directory to construct you React components, etc. If you want to separate the front and backend, then develop the Laravel side as an api and use react with react-router-dom and the new context api for the frontend.

Please or to participate in this conversation.