The Best of Laravel - Its Native Integration with Node
One of the features I like most about Laravel is that it comes integrated with Node by default. This means we can use both an excellent framework like Laravel on the server side and Node, which we usually use on the client side, that is, on the frontend, in a single project. This is something easily deduced. In this case, this is a project with Lara Inertia. You can see the pair of files here. On the one hand, we have package.json, which are the Node C files. When you create any Node project, these are generated.
We also have composer.json, which are PHP files. In this case, they are managed by the Laravel framework. If we compare it with other technologies, meaning other web frameworks, for example, in this case, it would be a Django project, but the same applies to Flask, FastAPI, or CodeIgniter. All of these frameworks are excellent, but they don't have that integration with Node.
Node and Laravel, the best combination
So if you want to create, which is also a bit typical, you want to have a project in your backend that does whatever the administrative part is and you want to have a nice frontend, in this case with Vue or in this case with React for example, you have to create what is a project here in your Backend, understood as Dijango, Flask, etc. And on the other hand, you have to create another project in parallel and independent of this one, in this case with Vue or whatever you want to use to consume yes or yes through a Rest Api or similar to your project in Django, etc.
The CDN, for testing only
You also have the option of the CDN for example that you could use in the case of Vue but you would be losing all the advantages that you have when using the Node ecosystem so in most cases it would not be a very good option and here we have a perfect integration in this case here we have a PHP as you can see a server and directly we return what is a component in view using the inertia method of course there are other ways so to speak I mean there are many integrations that we can do between the backend understand the Arabel with the frontend understand in this example using inertia which is a kind of wrapper with which we can directly use Vue or React understand that it is not only limited to the possibility of being able to work independently in two independent projects although they are linked in a single project what is the backend and the front end what is the what is the backend and the front end but we also have the possibility of using a technology as in this case is inertia that allows us to merge or have a better integration of both characteristics And this is something that has gained a little more strength starting with version 12, according to my judgment, in which as soon as you create a project here, it asks you if you want a project in Laravel, obviously all these options will have Laravel by default, obviously here you have it in a big way. If someone also asks you if you want a direct installation in Laravel or if you want to use React or Vue.
In this case, using Inertia, you have this possibility in which you have that perfect integration, although you can also go for a slightly more classic approach in which you have your RestAPI. Understand that here, as you can see, I have a controller or a grouping in which I call the API in which my entire API is located. And on the other hand, in this case, I am also using Vue not so directly, but through the traditional scheme that I mentioned, through an API.