Skip to content

Commit

Permalink
Added route to get all pizza
Browse files Browse the repository at this point in the history
  • Loading branch information
saxenanihal95 committed May 2, 2020
1 parent aa46282 commit 546a1fb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/Http/Controllers/PizzaController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
namespace App\Http\Controllers;
use App\Pizza;

class PizzaController extends Controller
{
public function index()
{
return Pizza::all()->toJson();
}
}

?>
4 changes: 4 additions & 0 deletions routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@
Route::get('user', 'AuthController@user');
});
});

Route::group(['middleware' => 'api', 'prefix' => 'pizza'], function ($router) {
Route::post('list', 'PizzaController@index');
});

0 comments on commit 546a1fb

Please sign in to comment.