Skip to content

Instantly share code, notes, and snippets.

@johnnyfreeman
Created April 30, 2023 18:58
Show Gist options
  • Save johnnyfreeman/4c88fc8ff28d93d1a6d63ee643215317 to your computer and use it in GitHub Desktop.
Save johnnyfreeman/4c88fc8ff28d93d1a6d63ee643215317 to your computer and use it in GitHub Desktop.
PHP Executable that defers to binary inside Laravel Sail
path=$(printf '%s\n' "${PWD##*/}")
command="docker exec ${path}-laravel.test-1 php "$@""
echo "Running php on docker ${path}-laravel.test-1"
$command
@johnnyfreeman
Copy link
Author

  1. Create php file
sudo touch /usr/local/bin/php
  1. Make it executable
sudo chmod +x /usr/local/bin/php
  1. Copy and paste the above script inside

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment