Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Sturm's avatar
Level 5

GrumPHP doesn't like Telescope

So I finally installed Laravel Telescope on our Laravel-based API. I am able to access it and it works as expected.

However, now when I attempt to run any commits, since we have GrumPHP added as a pre-commit hook, GrumPHP complains:

GrumPHP detected a pre-commit command.
GrumPHP is sniffing your code!
Running tasks with priority 0!
==============================
Running task 1/1: shell... 
Running task 1/1: shell... ✘

[ Removed the GrumPHP ANSI art for brevity ]

shell
=====
./vendor/bin/phpstan analyse ./app  --level 1
Note: Using configuration file /home/sturm/dev/intxlog/iel-docker/srv/itms-api/phpstan.neon.
Predis\Connection\ConnectionException thrown in /home/sturm/dev/intxlog/iel-docker/srv/itms-api/vendor/predis/predis/src/Connection/AbstractConnection.php on line 155 while loading bootstrap file /home/sturm/dev/intxlog/iel-docker/srv/itms-api/vendor/nunomaduro/larastan/bootstrap.php: php_network_getaddresses: getaddrinfo for redis failed: Name or service not known [tcp://redis:6379]
To skip commit checks, add -n or --no-verify flag to commit command

If I change REDIS_HOST in our .env file from redis to localhost, then it'll pass GrumPHP. But I've never had to do this before installing Telescope. REDIS_HOST must be set to redis in order for the app to function, so do I now have to change that line in .env every single time I commit?

0 likes
4 replies
Sinnbeck's avatar

What if you disable telescope?

TELESCOPE_ENABLED=false
Sturm's avatar
Level 5

@Sinnbeck Yes, that does allow committing. However, I would need to manually turn it back on whenever I need to use it. (Which, right now, is every day.)

Is there a better solution?

Sinnbeck's avatar

@Sturm you could perhaps update your pre commit hook to change it

Something like this

sed -i 's/TELESCOPE_ENABLED=true/TELESCOPE_ENABLED=false/g' ../../.env 

And it can do the reverse after grum is done running

1 like
Sturm's avatar
Level 5

@Sinnbeck I don't have much experience with git hooks, so I'm assuming I add your line to the file ./.git/hooks/pre-commit. It did not work.

However, if I add exec in front of the line, then it lets me make commits again, but the .env file isn't actually changed. Perhaps it only makes that change for the duration of the commit, so I don't need to reverse it manually?

Also, it seems that git hooks are not committed to the codebase; should they be? I feel like the other devs on my team could benefit from Telescope and having this modification to the pre-commit hook.

Please or to participate in this conversation.