Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP RESTful CRUD framework [closed]

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

like image 494
Dnns Avatar asked Oct 25 '13 09:10

Dnns


People also ask

How can we use rest and crud effectively?

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:

What are the best PHP API frameworks for REST APIs?

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.

What is the PHP MySQL CRUD framework?

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.

What is a RESTful web service in PHP?

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.


2 Answers

In some way the best and easy Php Framework for write API and RESTful application is

Slim Framework

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();
like image 169
gabrielem Avatar answered Oct 14 '22 05:10

gabrielem


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".

like image 24
Shahin Khani Avatar answered Oct 14 '22 05:10

Shahin Khani