[FAQ] Read this before posting a bug #402
Pinned
Roboroads
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey! Before you post a bug, please first check your interpreter settings. Most likely, your interpreter or path mappings are incorrect and this has nothing to do with the plugin.
I installed v3 and my tinker consoles are gone!
In v3, the tinker plugin moved from scratch files to its own filetype, so you can rename the files and add them wherever in your project. The biggest change is that scratch files are globally available in all project, while this new way is not. Since the plugin has no way of determining what project a scratch file belongs to, the files have not been migrated and they are still in the place there were originally placed. You can find them in the
${idea.config.path}/laravel-tinker
directory.Where is my idea.config.path?
Connection to database failed But site/tinker CLI works fine
99.9% sure you are using a local interpreter whilst your application is running in docker or a VM. In that case, the PHP tinker is using can, indeed, not reach your DB.
Go to your settings, and under PHP check your interpreter. Make sure you are using the same PHP executable as your CLI does. E.g., if you use sail, make sure you use the docker compose interpreter on your PHP container (laravel.test). If you use SSH (homestead/vagrant/vm/VPS) use the vagrant or SSH option.
If you do not have these options, make sure you have the "remote interpreters" plugin installed. It's bundled in PHPStorm, but not in IntelliJ
Cannot find classes or helper functions, error in
/in/nmH3n
,LaravelTinkerConsole.php
orconsole.tinker.php
Tinker runs your (and it's) code through the command line using something like
php -r '<tinker init code>' '<your code>' '<tinker settings>'
. So, if you receive an error that is in a file that's not from your project, like/in/nmH3n
(or some other random characters) or a file ending withLaravelTinkerConsole.php
or.tinker.php
you are not running your file through the Tinker plugin.In this case: make sure you do not use the default buttons and run commands the IDE gives you. Do use the buttons and shortkeys Tinker has added:
An error with the Tinker run code would not be a file but something like
in Command line code:1
Mounted volumes
If you use a remote/docker interpreter, please make sure that your project is shared with the interpreter. The interpreter you are using also needs to have access to all the files of your project. Also make sure that the working directory of the interpreter is setup in the forlder where your project is located on the interpreter.
If you're using an interpreter via SSH, make sure your project is fully uploaded to the interpreter and stays in sync.
Path mappings
Then, if your project is mounted, please also make sure that the right directory in the interpreter is also mapped to the absolute path on the host to the absolute path on the interpreter. That way, Tinker knows where to find your project.
Where to find this
Tinker Settings
If you can't change the working directory or your vendor/laravel folder is located somewhere else, tou can force override the folder (of the interpreter) in the project settings of the tinker plugin. You can find those under Tools > Laravel Tinker > Project settings. Z
3v4l.org
UPDATE: Update to v3, this will be gone.
Still having problems?
Beta Was this translation helpful? Give feedback.
All reactions