$routes->get('/chefs/index', function () { ChefController::index(); }); $routes->group('/admin', function () use($routes) { $routes->post('/change_account_activity/:id', 'check_if_admin', function ($id) { ChefController::toggle_activity($id); }); $routes->post('/change_account_admin_status/:id', 'check_if_admin', function ($id) { ChefController::toggle_admin_status($id); }); }); $routes->post('/search', function () { SearchController::search(); }); $routes->get('/results', function () { SearchController::show_search_results(); }); $routes->get('/keyword/:key', function ($keyword) { SearchController::find_by_keyword($keyword); }); $routes->group('/recipe', function () use($routes) { $routes->get('s', function () { RecipeController::index(); }); $routes->post('/', 'check_logged_in', function () { RecipeController::store(); }); $routes->get('/new', 'check_logged_in', function () { RecipeController::create(); }); $routes->get('/:id', function ($id) {