List Orders of a Restaurant
Learn about one more exciting feature of Laravel: Query Scopes.
We'll cover the following...
New URLs
We should let the user fetch the list of open orders and the list of completed orders of a restaurant.
<?php
// ...
Route::prefix('orders')->group(function () {
Route::get('/list-open', [OrderController::class, 'listOpen']);
Route::get('/list-completed', [OrderController::class, 'listCompleted']);
// ...
});
// ...
...