Closed jerguslejko closed 4 years ago
You should already be able to pipe stdin to Tinker and it will execute it interactively:
echo "dump(config('database'))" | php artisan tinker
You should already be able to pipe stdin to Tinker and it will execute it interactively:
The OP says their use case is Laravel Vapor. It's not clear to me if piping from stdin is easy there?
This PR adds
--execute
option to thephp artisan tinker
command.The idea is that by running
php artisan tinker --execute="dump(config('database'))"
, you can use tinker non-interactively.This allows the user to use tinker somewhat programmatically. It is extremely helpful in environments where an interactive shell is not available. Laravel Vapor for example. Debugging Vapor deployments becomes much easier.