Question

I am building an application which uses an API to get/save data rather than a MySQL database. The application is acting as an isolated front end.

I really like how the Laravel Eloquent ORM works but it seems to only work with the databases specified in the documentation.

Would it be possible to use Eloquent to interact with data on an API over HTTP/HTTPS?

Was it helpful?

Solution

No, it's not possible, mainly because each HTTP API has its own "format" so there's no easy way to create a tool that can be compatible with all existing APIs to provide a standard interface like Eloquent does.

What you can do however is create an extension that would interact with the API and provide the same methods that Eloquent does.

If you need libraries for consuming an API, you can try Guzzle or Httpful, both installable via Composer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top