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.


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 :

Referensi :

Dilihat sebanyak : 137 kali

Print Friendly, PDF & Email

Leave a Reply

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

[+] kaskus emoticons nartzco