Laravel

Laravel 5.1 Dingo API

Laravel 5.1 Dingo API

 

Dingo is One of the Best API to create RESTFul API for Laravel. Built In Dingo Will handle all the exception functions.
Here we can see how to install it and execute in Laravel.

Step 1 : Install Dingo Api

Laravel 5.1 need “phpdocumentor/reflection” to install Dingo API otherwise you will failed to install Dingo API.
Add the below two lines in COMPOSER.JSON file under require and run Composer update

DIngo insert

 

Step 2 : Add Service Provider

Add Dingo Service Provider to config/app.php file.

Step 3 : Publish Dingo

Publish Dingo Api by using below Artisan command.

It will create the api.php file under config/api.php

Step 4 : Modify api.php

Change

The api.php will looks like below



 Step 5 : Create Route

 Step 6 : Viewing Routes In The Console :

Run the below command interminal

It will return the Route urls like below.

Dingo Api View ROutes

Thats it You have fininished installation of Dingo API.
You can Check it in URL : http://url.com/api/hello

It will return the result as “Hello you are running Dingo Api”.

For more details about dingo please refer https://github.com/dingo/api/wiki.

Happy Coding!.
If you like this article don’t forget to share and commant.
Thanks!.