Created
September 28, 2021 16:30
-
-
Save meeglos/99838444aa5ab0e1a16df5142770004e to your computer and use it in GitHub Desktop.
VS Code PHP validation executable Laravel Sail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- In VS Code settings, search for settings.json: | |
"php.validate.executablePath": "/usr/local/bin/php" | |
- Edit the file: | |
sudo nano /usr/local/bin/php | |
Paste the code: | |
path=$(printf '%s\n' "${PWD##*/}") | |
command="docker exec ${path}_laravel.test_1 php "$@"" | |
echo "Running php on docker ${path}_laravel.test_1" | |
$command | |
Save and exit | |
Then, make it executable: | |
sudo chmod +x /usr/local/bin/php |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment