File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6464// App\Http\Middleware\ExampleMiddleware::class
6565// ]);
6666
67- // $app->routeMiddleware([
67+ $ app ->routeMiddleware ([
6868// 'auth' => App\Http\Middleware\Authenticate::class,
69- // ]);
69+ 'jwt-auth ' => \Tymon \JWTAuth \Http \Middleware \Authenticate::class,
70+ ]);
7071
7172/*
7273|--------------------------------------------------------------------------
Original file line number Diff line number Diff line change 1515 return $ router ->app ->version ();
1616});
1717
18- $ router ->post ('/auth/login ' , 'AuthController@postLogin ' );
18+ $ router ->post ('/auth/login ' , 'AuthController@postLogin ' );
19+
20+ $ router ->group (['middleware ' => 'jwt-auth ' ], function () use ($ router )
21+ {
22+ $ router ->get ('/test ' , function () {
23+ return response ()->json ([
24+ 'message ' => 'Hello World! ' ,
25+ ]);
26+ });
27+ });
You can’t perform that action at this time.
0 commit comments