Consider the following architecture:
ThisisaverymoderntemplatewheretheAPIprovidesend-pointsfordifferentservicestodotransactionswiththedatabase.
I'mabeggineruserinLaravel,somyquestionisabeginner'squestionregardingtheFramework.
Laravel,aswellasotherframeworkslikeSimfonyforexample,haveapowerfulORMthatsavesalotofdevelopmenttime.InLaraveltheEloquentseemstobealsothebasisofmanyotherfacilitieslikemigrations,seeds,layersofauthentications,amongothers.
Ifthepreviousideaistrue,itseemslogicaltomethatifwedecidenottousetheLaravelORM,orthemigrationswewilllosemuchofLaravel'spower.
Ontheotherhand,thinkingabouttheabovedrawingscheme,whatwouldaWebSite/APPimplementationthatonlyconsumesendpointsofanAPIbe?AtthemomentI'musing Guzzle to make use of the endpoints. But in that case, my Web Site / APP will not need ORM, nor Eloquent, nor will I need seeds or migrations. So it seems logical that in this scenario I will be losing the advantages of Laravel.
And if this conclusion is true, I will inevitably be forced to question Laravel's advantage for non-monolithic architecture designs.
Even within the API-Restful where I could use all the features of ORM the use of Laravel is questionable because here I will not need the views, I will not use blade and tbm the whole package of associated features.
Perhaps this is why there is a ligth version of laravel to handle the development of APIs, the Lumen , which, according to your website , gives us the advantage of having something around 1900 connections per second. But there are other options for developing php APIs such as Phalcon , in addition to Lumen, which are considered high-performance php frameworks . In addition there is the possibility of using Javascript with NodeJs to develop the completeness of the API. The purpose here of this post (which is my doubt) is not to discuss the performance of each of these options or to qualify who is worse or better.
The fact is it seems that the Laravel 5.x framework (5.4 is what I'm using now) does not seem to be the right choice to build the API as well if it is chosen to be done in PHP).
Well, if to create the Web Site / APP Laravel, which will not use the ORM and its amenities, it seems to make no sense, and to create the API > Laravel seems to be not the first choice, we would have to conclude that Laravel (and other similar frameworks) may not be a good choice for microservices design and, by the way, the modern web.
So do not leave this thought open, so that you set yourself off-topic, my exact question remains:
How to implement the Laravel ORM in a Web Site / APP project that will consume end-points of an API? Will you need to have the Models or the data already come directly from the Controls? Will you have to replicate the entire Database in migrations and Models to be able to use the benefits of queries? I can not see how to implement this ORM.