Skip to content

Instantly share code, notes, and snippets.

@meeglos
Created September 28, 2021 16:30
Show Gist options
  • Save meeglos/99838444aa5ab0e1a16df5142770004e to your computer and use it in GitHub Desktop.
Save meeglos/99838444aa5ab0e1a16df5142770004e to your computer and use it in GitHub Desktop.
VS Code PHP validation executable Laravel Sail
- 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