Skip to content

Commit 10e333a

Browse files
authored
Merge pull request #5827 from Laravel-Backpack/lifecycle-hooks-registering-issue
fix hooks
2 parents daf3c86 + dcfda85 commit 10e333a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/app/Library/CrudPanel/Hooks/LifecycleHooks.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ public function trigger(string|array $hooks, array $parameters = []): void
2525

2626
foreach ($hooks as $hook) {
2727
// Create a unique identifier for this controller+hook combination
28-
$hookId = is_null($controller) ? '' : (is_string($controller) ? $controller : $controller::class.'::'.$hook);
28+
// Include the full hook name (which includes operation) to ensure uniqueness per operation
29+
$hookId = is_null($controller) ? $hook : (is_string($controller) ? $controller : $controller::class).'::'.$hook;
2930

3031
// Skip if this hook has already been executed
3132
if (isset($this->executedHooks[$hookId])) {

0 commit comments

Comments
 (0)