Skip to content

Commit 6899c2c

Browse files
authored
Fixed error "method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given" when using Livewire and AdminLTE. (#524)
* Fixed error 'method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given' when using Darryldecode\Cart\Cart. * Check if the $event variable is an object before checking if it was dispatched by NativePHP.
1 parent a8b0a72 commit 6899c2c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Events/EventWatcher.php

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ public function register(): void
1414
Event::listen('*', function (string $eventName, array $data) {
1515
$event = $data[0] ?? (object) null;
1616

17+
if(! is_object($event)) {
18+
return;
19+
}
20+
1721
if (! method_exists($event, 'broadcastOn')) {
1822
return;
1923
}

0 commit comments

Comments
 (0)