laravel / tinker

Powerful REPL for the Laravel framework.
https://laravel.com/docs/artisan#tinker
MIT License
7.34k stars 130 forks source link

Configurable Psy Options via Tinker Configs #56

Closed rexfordkelly closed 6 years ago

rexfordkelly commented 6 years ago

Looks like there is no support for custom Psy shell options via Tinker's configuration options. I looked in the documentation and could find no mention of it.

-- There is a way to bypass Laravel's configuration sys completely by setting a PSYSH_CONFIG env variable, but even then, you would end up with at least one additional file for those configurations somewhere.

So I've patched Tinker, to handle such a use case.

To see it in action, you would need to:

php artisan vendor:publish --publisher=laravel\tinker --tag=config.

Then uncomment the lines in the config/tinker.php file.

Then run php artisan config:clear, to ensure its picked up.

Now when you run php artisan tinker you should see a new custom prompt.

It should work with all other Psy configuration options too. - :)

taylorotwell commented 6 years ago

This PR does not follow Laravel's code formatting conventions.