Book a Table

Learn the importance of having dedicated routes for each different kind of action.

New API endpoint

We will add a new route under the restaurant_required route group. You may have noticed that we are keeping our routes specific and dedicated to a single action. This practice is beneficial when designing large or complex web applications. Rather than trying to keep the number of routes to a minimum, you should try to keep them as specific as possible to avoid any confusion.

<?php
// ...
        Route::prefix('orders')->group(function () {
            Route::post('/book-a-table/{tableId}',
...