Skip to content

Commit 67e0702

Browse files
authored
Merge pull request #5283 from Laravel-Backpack/allow-dynamic-hrefs-in-quick-button
allow dynamic href in quick button
2 parents cc743c3 + 447c812 commit 67e0702

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/resources/views/crud/buttons/quick.blade.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
$wrapper = $button->meta['wrapper'] ?? [];
1515
$wrapper['element'] = $wrapper['element'] ?? 'a';
1616
$wrapper['href'] = $wrapper['href'] ?? $defaultHref;
17+
if (is_a($wrapper['href'], \Closure::class, true)) {
18+
$wrapper['href'] = ($wrapper['href'])($entry, $crud);
19+
}
1720
$wrapper['class'] = $wrapper['class'] ?? $defaultClass;
1821
@endphp
1922

0 commit comments

Comments
 (0)