Advertisement
bngoding

api

Jun 21st, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. <?php
  2.  
  3. use Illuminate\Http\Request;
  4.  
  5. /*
  6. |--------------------------------------------------------------------------
  7. | API Routes
  8. |--------------------------------------------------------------------------
  9. |
  10. | Here is where you can register API routes for your application. These
  11. | routes are loaded by the RouteServiceProvider within a group which
  12. | is assigned the "api" middleware group. Enjoy building your API!
  13. |
  14. */
  15.  
  16. Route::middleware('auth:api')->get('/user', function (Request $request) {
  17. return $request->user();
  18. });
  19. Route::get('/product/{id}', 'OrderController@getProduct');
  20. Route::post('/cart', 'OrderController@addToCart');
  21. Route::get('/cart', 'OrderController@getCart');
  22. Route::delete('/cart/{id}', 'OrderController@removeCart');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement