HomeBrew is an excelent package manager but they have to many movementes so this things like install xdebug are a little bit confused.
In my case I have all my environment ready thanks to valet, I just need to install xdebug if you dont have your environment ready this link could be usefull for you https://laravel.com/docs/5.6/valet
Extensions such as php-xdebug and php-mongodb have been removed and now should be installed from PECL:
pecl install xdebug
If you have some trubles in
php formula and if it’s still not fixed, you may need to move your extension from: /usr/local/lib/php/pecl into /usr/local/Cellar/php/7.2.8/lib/php/ manually.