Zend certified PHP/Magento developer

Problems with linuxbrew packages

I don’t know Linux as well as I’d like to, and I’m starting to get familiar with Linux and package management. I have linuxbrew installed, the version of Homebrew for linux. I have installed php, mysql and redis. With composer I globally installed the “cpriego/valet-linux” package, when I execute the valet install command of the package it tells me: “php command not found”, which means that none of the installed packages are available in root mode. On second thought, I realized that linuxbrew is in the home directory, I guess that’s why I don’t need to run brew with sudo. In the terminal, when I run php -v it tells me that php 8.2 is installed and everything it would say normally but in root mode it doesn’t recognize any packages.

Is there a way to use linuxbrew packages in root mode?