Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.x] Add --execute option to console command #89

Merged
merged 2 commits into from
Feb 4, 2020

Conversation

jerguslejko
Copy link
Contributor

This PR adds --execute option to the php 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.

@driesvints driesvints changed the title add --execute option to console command [2.x] Add --execute option to console command Feb 4, 2020
@StanAngeloff
Copy link
Contributor

You should already be able to pipe stdin to Tinker and it will execute it interactively:

echo "dump(config('database'))" | php artisan tinker

@GrahamCampbell
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants