Skip to content

Commit 303b977

Browse files
authored
Update Middleware.php
1 parent ae46e7b commit 303b977

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/Middleware.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ public static function load($allMiddlewares, string $plugin = '')
4343
if (!is_array($middlewares)) {
4444
throw new RuntimeException('Bad middleware config');
4545
}
46+
if (strpos($appName, 'plugin.') !== false) {
47+
$explode = explode('.', $appName, 4);
48+
$plugin = $explode[1];
49+
$appName = $explode[2] ?? '';
50+
}
4651
foreach ($middlewares as $className) {
4752
if (method_exists($className, 'process')) {
4853
static::$instances[$plugin][$appName][] = [$className, 'process'];

0 commit comments

Comments
 (0)