+ @foreach($commandBar as $command)
+
+ {!! $command !!}
+
+ @endforeach
+
+
@foreach($manyForms as $key => $layouts)
@foreach($layouts as $layout)
{!! $layout ?? '' !!}
@@ -22,7 +31,7 @@
@endforeach
- @empty(!$commandBar)
+ @if($commandBar && !$topCommandBar)
@foreach($commandBar as $command)
@@ -30,7 +39,7 @@
@endforeach
- @endempty
+ @endif
diff --git a/src/Screen/Layouts/Block.php b/src/Screen/Layouts/Block.php
index 3ff454cd63..0103a13f3f 100644
--- a/src/Screen/Layouts/Block.php
+++ b/src/Screen/Layouts/Block.php
@@ -27,6 +27,7 @@ abstract class Block extends Layout
*/
protected $variables = [
'vertical' => false,
+ 'topCommandBar' => false,
];
/**
@@ -98,11 +99,14 @@ public function vertical($vertical = true): self
return $this;
}
+
/**
* @param Action|Action[] description
*/
- public function commands($commands): self
+ public function commands($commands, $top = false): self
{
+ $this->variables['topCommandBar'] = $top;
+
$this->commandBar = Arr::wrap($commands);
return $this;