I really like working with SailsJS (http://sailsjs.org). Especially because it automatically generates a RESTful CRUD API. However, working for small clients, I don't always have the opportunity of working in a NodeJS environment. Mostly their webapps run on an Apache (PHP/MySQL) server.
My question: Is there any framework that provides an automatically generated RESTful CRUD API? If not, what is the best approach to write it myself?
I'm aware of frameworks that handle routing, however I'm looking for something that automatically generates CRUD API (based on blueprints or linked to the database tables).
For speeding up the development process and keeping my code clean I also like ORM's. It would be nice if I could link the automatically generated API to the ORM schema/blueprint. So once again, what is the best way to approach this?
I couldn't find any frameworks that provide this. Hope you guys can help me out.
Thanks in advance!
Dennis
We can use REST and CRUD effectively by separating our operations into different services with their own resources and enabling access to them through via our REST API. In the next tutorials on PHP and Microservices, we are going to cover:
Github and Stackoverflow will be the primary indicators for vibrant development communities. Based on those three criteria, this is what I’ve found as a list of the top contenders for PHP API Frameworks: What are the best PHP API Frameworks for REST APIs? The stunningly fast micro-framework by Laravel.
This PHP database framework supports MySQL, PostgreSQL, and SQLite databases. You can use this PHP MySQL CRUD framework to generate both the front-end and back-end of your application. By writing only two to three lines of code, you can perform insert, update, delete, and select operations with an interactive table.
By meeting more of the REST constraints, the web applications or services can support a wide range of clients. In the PHP RESTful web service example, the following domain class contains the resource data array and service handlers. These handlers are called based on the request sent by the REST client or external apps.
In some way the best and easy Php Framework for write API and RESTful application is
Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs. slimframework.com
hello world:
<?php
$app = new \Slim\Slim();
$app->get('/hello/:name', function ($name) {
echo "Hello, $name";
});
$app->run();
This is a restful api framework that can get you started pretty fast http://luracast.com/products/restler I've used it in the past. very fast and lean.
however developing APIs is fairly easy. some other light frameworks are Slim Php.
Zend is really heavy.. but you can pretty much extend their zend Rest class and write your own which will be the "easiest".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With