File tree Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace App \Http \Controllers ;
4+
5+ use Illuminate \Http \Request ;
6+
7+ class TestController extends Controller
8+ {
9+ public function index () {
10+ $ data = [
11+ [
12+ 'first_name ' => 'Sajeeva ' ,
13+ 'last_name ' => 'Hasith ' ,
14+ 'location ' => 'Colombo '
15+ ],
16+ [
17+ 'first_name ' => 'Anjana ' ,
18+ 'last_name ' => 'Porawagama ' ,
19+ 'location ' => 'Colombo '
20+ ]
21+ ];
22+
23+ return response ()->json ($ data , 200 );;
24+ }
25+ }
Original file line number Diff line number Diff line change 1616Route::middleware ('auth:api ' )->get ('/user ' , function (Request $ request ) {
1717 return $ request ->user ();
1818});
19+
20+ Route::get ('users ' , 'TestController@index ' );
Original file line number Diff line number Diff line change 1414Route::get ('/ ' , function () {
1515 return view ('welcome ' );
1616});
17+
18+ Route::get ('/test ' , function () {
19+ return ["message " => "test api " ];
20+ });
You can’t perform that action at this time.
0 commit comments