question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for custom "Run Tinker with using custom command"

See original GitHub issue

This request is related to this bug report.

Background

Recently, my team split our app into a few Docker containers. Prior to this, I was using PHPStorm Laravel Tinker extensively with an interpreter installed globally on my machine.

Now that we’ve moved to Docker, I’d like to also change my PHP interpreter to use our Docker’s binary instead of my local machine’s (for consistency). I’ve been able to set my interpreter to Docker, but when I run Laravel Tinker I don’t see anything in the output panel.

An example

image

Interpreter Settings

image

Requested Feature

Per Roboroad’s comment, I would find it very helpful to be able to set Laravel Tinker to run with a custom command (e.g. A setting to tell Laravel Tinker to run its commands via ./vendor/bin/sail php artisan tinker)

The ultimate goal of this feature request is to get an output in the output panel when using a PHP interpreter inside a Docker container.

Possible Alternatives

I will update this section if I come up with any alternative ideas.

  • Nothing to see here yet

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Roboroadscommented, Jan 25, 2022

Oh, fun fact, i have this problem myself now - my laravel project is in a subfolder from the larger project. Might be something to do with that.

1reaction
Roboroadscommented, Jan 23, 2022

A setting to tell Laravel Tinker to run its commands via ./vendor/bin/sail php artisan tinker

Note that the plugin never actually runs php artisan tinker, rather php -r <init code> <your code>. This is using the interpreter PHPstorm uses.

Please check your settings of your PHP Interpreter and path mapping again, All the people I have spoken to have the same problem, but fixed it with using correct settings

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to add custom casters in Laravel Tinker - SoftOnSofa
I made a series about psysh and Laravel's tinker – powerful REPL ... Command, which will allows us to provide array with customized...
Read more >
Artisan Console - Laravel - The PHP Framework For Web ...
To enter the Tinker environment, run the tinker Artisan command: ... addition to the commands provided with Artisan, you may build your own...
Read more >
How to make a custom command in Laravel
You can publish tinker's configuration file using the 'vendor:publish' command. php artisan vendor:publish --provider="Laravel\Tinker\TinkerServiceProvider".
Read more >
Can I run a command in Laravel Tinker within just one entry in ...
You can use: php artisan tinker --execute="dump(User::find(1)->email)" which you can write a little bit shorter to be php artisan tinker ...
Read more >
Supercharge Your Laravel Tinker Workflow - Tighten Co.
Tinker, accessed via php artisan tinker, is arguably my favorite ... PsySH supports custom configuration through a config file stored in ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found