DEV Community

Discussion on: Refactoring #1: Using ternary and null coalescing operators in PHP

 
abhinav1217 profile image
Abhinav Kulshreshtha

Your approach is correct.
Make 2 projects, Laravel API, (or lumen) and a React frontend.

Serve React site (node server) on your-domain.com, and fetch data from api.your-domain.com will be your php-laravel endpoint.

Once you have done that, you can use server-side rendering ( and later a technique called hydration ) to your first load, that will help with SEO.
SEO is mostly related to what is served on front, so you need to work on SEO techniques on your react front-end. Depending on your need you might not need to do anything seo related in laravel api except for making sure http codes are proper.

Thread Thread
 
askoflor profile image
askoflor

thank you for your contribution