@@ -43,7 +43,7 @@ public function load(mixed $resource, string $type = null): ?RouteCollection
4343return new RouteCollection ();
4444 }
4545
46- return $ this ->loadFromDirectory ($ path ,trim ($ resource ['namespace ' ],'\\' ));
46+ return $ this ->loadFromDirectory ($ path ,trim ($ resource ['namespace ' ],'\\' ), $ type );
4747 }
4848
4949public function supports (mixed $ resource ,string $ type =null ):bool
@@ -59,7 +59,7 @@ public function forDirectory(string $currentDirectory): static
5959return $ loader ;
6060 }
6161
62- private function loadFromDirectory (string $ directory ,string $ psr4Prefix ):RouteCollection
62+ private function loadFromDirectory (string $ directory ,string $ psr4Prefix, string $ type ):RouteCollection
6363 {
6464$ collection =new RouteCollection ();
6565$ collection ->addResource (new DirectoryResource ($ directory ,'/\.php$/ ' ));
@@ -92,7 +92,7 @@ function (\SplFileInfo $current) {
9292continue ;
9393 }
9494
95- $ collection ->addCollection ($ this ->import ($ class ,' attribute ' ));
95+ $ collection ->addCollection ($ this ->import ($ class ,$ type ));
9696 }
9797
9898return $ collection ;