From 536b9ce8667c64873edf9ef8bc5f93b41818ef59 Mon Sep 17 00:00:00 2001 From: Virgil-Adrian Teaca Date: Sat, 13 Jul 2019 23:18:33 +0300 Subject: [PATCH] Improve the routes --- app/Routes/Assets.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/Routes/Assets.php b/app/Routes/Assets.php index ddff89fa..ef2221c2 100644 --- a/app/Routes/Assets.php +++ b/app/Routes/Assets.php @@ -14,9 +14,7 @@ // Register the route for assets from Packages, Modules and Themes. $dispatcher->route('packages/(:any)/(:any)/(:all)', function (Request $request, $vendor, $package, $path) use ($dispatcher) { - $namespace = $vendor .'/' .$package; - - if (is_null($packagePath = $dispatcher->getPackagePath($namespace))) { + if (is_null($packagePath = $dispatcher->getPackagePath($vendor, $package))) { return Response::make('File Not Found', 404); } @@ -26,9 +24,7 @@ // Register the route for assets from Vendor. $dispatcher->route('vendor/(:all)', function (Request $request, $path) use ($dispatcher) { - $paths = $dispatcher->getVendorPaths(); - - if (! Str::startsWith($path, $paths)) { + if (! Str::startsWith($path, $dispatcher->getVendorPaths())) { return Response::make('File Not Found', 404); }