diff --git a/api/app/Http/Controllers/MenuController.php b/api/app/Http/Controllers/MenuController.php new file mode 100644 index 0000000..59f5c28 --- /dev/null +++ b/api/app/Http/Controllers/MenuController.php @@ -0,0 +1,30 @@ +select('SELECT id, title, link, is_special FROM site_menu WHERE ((visible_from IS NULL AND visible_to IS NULL) OR (visible_from <= NOW() AND visible_to >= NOW()))'); + $items = []; + foreach($query as $item) + { + $items[$item->id] = ['title' => $item->title, 'link' => $item->link, 'special' => $item->is_special]; + } + + return $items; + } +} diff --git a/api/routes/web.php b/api/routes/web.php index 849b337..8f66b30 100644 --- a/api/routes/web.php +++ b/api/routes/web.php @@ -15,6 +15,8 @@ $app->get('/', function () use ($app) { return redirect('docs'); }); +$app->get( 'menu/special', 'MenuController@special' ); + $app->get('nieuws/overzicht', 'NewsController@newslist' ); $app->get('nieuws/regio/{region:[a-z0-9-]+}', 'NewsController@regionlist' ); $app->get('nieuws/thema/{theme:[a-z0-9-]+}', 'NewsController@themelist' );