...

/

Transitioning Table States

Transitioning Table States

Discover one more way to keep your controllers lean while adding the code for state transitions.

New API endpoints

Now that we have set up the table state rules, we can add new API endpoints that will allow users to change the state of a table.

<?php 
// ...
Route::post('/mark-as-non-operational/{tableId}', [TableStatusController::class, 'markAsNonOperational']);
            Route::post('/mark-as-available/{tableId}', [TableStatusController::class, 'markAsAvailable']);
            Route::post('/mark-as-reserved/{tab
...