Skip to content

Commit 186a82b

Browse files
committed
Allow array parameter on buttons option for api consistency.
1 parent 370287f commit 186a82b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Html/Options/Plugins/Buttons.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,16 @@ trait Buttons
1515
/**
1616
* Attach multiple buttons to builder.
1717
*
18-
* @param mixed ...$buttons
18+
* @param array|mixed ...$buttons
1919
* @return $this
2020
* @see https://www.datatables.net/extensions/buttons/
2121
*/
2222
public function buttons(...$buttons)
2323
{
24+
if (is_array($buttons[0])) {
25+
$buttons = $buttons[0];
26+
}
27+
2428
foreach ($buttons as $button) {
2529
$this->attributes['buttons'][] = $button instanceof Arrayable ? $button->toArray() : $button;
2630
}

0 commit comments

Comments
 (0)