We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 370287f commit 186a82bCopy full SHA for 186a82b
src/Html/Options/Plugins/Buttons.php
@@ -15,12 +15,16 @@ trait Buttons
15
/**
16
* Attach multiple buttons to builder.
17
*
18
- * @param mixed ...$buttons
+ * @param array|mixed ...$buttons
19
* @return $this
20
* @see https://www.datatables.net/extensions/buttons/
21
*/
22
public function buttons(...$buttons)
23
{
24
+ if (is_array($buttons[0])) {
25
+ $buttons = $buttons[0];
26
+ }
27
+
28
foreach ($buttons as $button) {
29
$this->attributes['buttons'][] = $button instanceof Arrayable ? $button->toArray() : $button;
30
}
0 commit comments