From 947c7952431a423b54eeb71e3e3a7c1d068c2d7a Mon Sep 17 00:00:00 2001 From: jeric Date: Thu, 12 Mar 2020 10:13:59 +0800 Subject: [PATCH] updated route protection, composer version --- composer.json | 2 +- src/BugphixServiceProvider.php | 2 +- src/Publishable/config/bugphix.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 0881af6..d040ee8 100644 --- a/composer.json +++ b/composer.json @@ -47,7 +47,7 @@ }, "require-dev": { "phpunit/phpunit": "~6.0", - "laravel/laravel": "^6|^7", + "laravel/laravel": "~6.0", "orchestra/testbench": "^4.0" } } diff --git a/src/BugphixServiceProvider.php b/src/BugphixServiceProvider.php index 95f7d15..e52ab84 100644 --- a/src/BugphixServiceProvider.php +++ b/src/BugphixServiceProvider.php @@ -67,7 +67,7 @@ protected function registerRoutes() private function isRouteProtected() { $prefix = $this->routeConfig()['prefix'] ?? $this->defaultAdminSlug; - $middleware = $this->routeConfig()['middleware'] ?? []; + $middleware = array_diff( $this->routeConfig()['middleware'] ?? [], ['web','api'] ); // excluding web and api as middleware $isLocal = app()->environment('local'); return $isLocal || count($middleware) || ($prefix !== $this->defaultAdminSlug); diff --git a/src/Publishable/config/bugphix.php b/src/Publishable/config/bugphix.php index 819e4d2..4427841 100644 --- a/src/Publishable/config/bugphix.php +++ b/src/Publishable/config/bugphix.php @@ -30,7 +30,7 @@ |-------------------------------------------------------------------------- */ 'assets' => [ - 'url' => 'bugphix-assets' // modify this if you need to update the assets file path of bugphix, it will also accept full url + 'url' => rtrim('/', env('APP_URL', '')) . '/bugphix-assets' // modify this if you need to update the assets file path of bugphix, it will also accept full url ], /*