Merge pull request #579 from mpociot/ignore-telescope-routes

Exclude Laravel Telescope routes by default
This commit is contained in:
Shalvah
2019-09-07 15:59:48 +01:00
committed by GitHub
4 changed files with 9 additions and 3 deletions

3
.gitignore vendored
View File

@@ -2,7 +2,8 @@
composer.lock
.php_cs.cache
/vendor/
/public
public/
tests/public/
.idea/
coverage.xml
results.xml

View File

@@ -50,7 +50,7 @@
"scripts": {
"lint": "phpstan analyse -c ./phpstan.neon src",
"test": "phpunit --stop-on-failure",
"test-ci": "phpunit --coverage-clover=coverage.xml"
"test-ci": "phpunit"
},
"extra": {
"laravel": {

View File

@@ -99,7 +99,7 @@ class ResponseCalls extends Strategy
*
* @return void
*
* @deprecated in favour of Laravel config variables
* @deprecated Not guaranteed to overwrite application's env. Use Laravel config variables instead.
*/
private function setEnvironmentVariables(array $env)
{

View File

@@ -83,6 +83,11 @@ class RouteMatcher
{
$excludes = $routeRule['exclude'] ?? [];
// Exclude Laravel Telescope routes
if (class_exists("Laravel\Telescope\Telescope")) {
$excludes[] = 'telescope/*';
}
return Str::is($excludes, $route->getName())
|| Str::is($excludes, $route->uri());
}