REST API using Lumen framework by Laravel

REST API using lumen framework by laravel

Installation Lumen via Composer :

install Composer documentation

If the packages are downloaded then we will start to modify app.php file which is located atbootstrap/app.php for enable or disable the features what we need. So we are going to enable Eloquent and Facade.

bootstrap/app.php(Changes)

Setting db using .env

Create Migration :

Create the migration table and the name table is articles

After run, edit file in database/migrations

Code :

and then run migrate

Create Model:

create article at app/ directory

Create Controller:

create new ArticleController.php file to Http/Controller.

Setting Route :

Done simple REST API implementation using lumen and you can check the api with Advanced REST client (Chrome), RESTClient (Mozilla Firefox).

Testing with Advanced REST client

Download project : https://github.com/MhdSyarif/lumen-rest-API

Referensi : wsnippets.com/create-rest-api-using-lumen-micro-framework-by-laravel

Dilihat sebanyak : 84 kali

Print Friendly

Leave a Reply

Your email address will not be published. Required fields are marked *

*

code

[+] kaskus emoticons nartzco