Liveblog basic functionality

This commit is contained in:
NH Gooi
2026-02-11 19:36:53 +01:00
parent b78379f268
commit 6786ac7ce1
3 changed files with 35 additions and 2 deletions

View File

@@ -112,12 +112,18 @@ class NewsController extends Controller
public function liveblog(Request $request, $id)
{
parent::registerView($request, 'blog', $id);
$blog = $this->API('nieuws/liveblog/' . (int) $id);
foreach( $blog->artikelen as &$item ) {
$item = new \Model\NewsItem( $item );
foreach ($blog->artikelen as &$item) {
$item = new \Model\NewsItem($item);
}
if (request()->ajax()) {
return $blog;
}
if (count($blog->artikelen)) {
return view('blog', ['blog' => $blog]);
}