File tree Expand file tree Collapse file tree 1 file changed +11
-14
lines changed Expand file tree Collapse file tree 1 file changed +11
-14
lines changed Original file line number Diff line number Diff line change 11<?php
22
3- use Illuminate \Http \Request ;
3+ // use Illuminate\Http\Request;
44use Illuminate \Support \Facades \Route ;
55
6- /*
7- |--------------------------------------------------------------------------
8- | API Routes
9- |--------------------------------------------------------------------------
10- |
11- | Here is where you can register API routes for your application. These
12- | routes are loaded by the RouteServiceProvider within a group which
13- | is assigned the "api" middleware group. Enjoy building your API!
14- |
15- */
6+ use App \Http \Controllers \Api \CategoryController ;
7+ use App \Http \Controllers \Api \ProductController ;
8+ use App \Http \Controllers \Api \UserController ;
169
17- Route::middleware ('auth:api ' )->get ('/user ' , function (Request $ request ) {
18- return $ request ->user ();
19- });
10+ Route::get ('/categories ' , [CategoryController::class, 'index ' ]);
11+ Route::get ('/categories/{category} ' , [CategoryController::class, 'show ' ]);
12+
13+ Route::get ('/products ' , [ProductController::class, 'index ' ]);
14+ Route::get ('/products/{product} ' , [ProductController::class, 'show ' ]);
15+
16+ Route::post ('/purchase ' , [UserController::class, 'purchase ' ]);
You can’t perform that action at this time.
0 commit comments