Skip to content

Commit e54d179

Browse files
committed
Prevent rendering of tab menu when it has no items
1 parent 6194c52 commit e54d179

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Screen/Layouts/TabMenu.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,19 @@ abstract class TabMenu extends Layout
2424
/**
2525
* @throws Throwable
2626
*
27-
* @return Factory|\Illuminate\View\View
27+
* @return Factory|\Illuminate\View\View|void
2828
*/
2929
public function build(Repository $repository)
3030
{
3131
$this->query = $repository;
3232

33-
if (! $this->isSee()) {
33+
$navigations = $this->navigations();
34+
35+
if (! $this->isSee() || empty($navigations)) {
3436
return;
3537
}
3638

37-
$form = new Builder($this->navigations(), $repository);
39+
$form = new Builder($navigations, $repository);
3840

3941
return view($this->template, [
4042
'navigations' => $form->generateForm(),

0 commit comments

Comments
 (0)