September 2017
Intermediate to advanced
244 pages
6h 44m
English
If you look at the routes/web.php file where we put our routes, you can see that we wrote 54 lines of code for post and comment endpoints. With Dingo API, we can replace those 54 lines with just 10 lines of code, and it will be even more cleaner. So let's do that. Here is how your routes/web.php file should look:
<?php/*|----------------------------------------------------------------| Application Routes|----------------------------------------------------------------|| Here is where you can register all of the routes for an application.| It is a breeze. Simply tell Lumen the URIs it should respond to| and give it the Closure to call when that URI is requested.|*/$api = app('Dingo\Api\Routing\Router');$api->version('v1', ...
Read now
Unlock full access