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

[Bug]: Laravel detection fails when Laravel is included by another composer dependency #364

Open
1 task done
caimaxtingle opened this issue Aug 20, 2024 · 1 comment
Open
1 task done
Labels
bug Something isn't working keep active This issue is exempt from going stale

Comments

@caimaxtingle
Copy link

Short bug description

When including Laravel via another composer dependency it's not booted in tinker

Extended bug description

Since the addition of Laravel detection composer set-ups where another composer.json dependency includes laravel/framework no longer work with the tinker plugin, as $isLaravelProject (of tinker_run.php) is false and thus the kernel isn't required/bootstrapped

Your project is not the problem

  • I tried using a fresh laravel install - I'm fairly certain it has nothing to do with my project.

How to reproduce?

  1. Create a repo which includes a composer.json that requires laravel/framework
  2. Create another repo which includes the first repo in its composer.json
  3. Attempt to use a Laravel function in tinker, eg: echo app()->environment() . PHP_EOL;

Expected behavior

Laravel would be booted and the code execute under tinker

Screenshots

No response

IDE & Version

PHPStorm 2024.1.4

PHP Version

8.3

OS and version

Windows 11

Laravel Tinker plugin version

2.7.3

Interpreter type

Remote

Laravel Version

v11.18.0

Tinker version

v2.9.0

Psysh version

v0.12.4

Additional Context

Simply checking the composer.lock instead of the composer.json to see if Laravel exists will resolve this problem

@caimaxtingle caimaxtingle added the bug Something isn't working label Aug 20, 2024
@Roboroads
Copy link
Owner

Roboroads commented Sep 9, 2024

Hmmmmmmmmmmmmm, yea I could see that being a problem. Should detect if the file vendor/laravel/framework/conposer.json exists maybe instead. Or indeed, check the lockfile (if that's an easier option, idk..)

@Roboroads Roboroads added the keep active This issue is exempt from going stale label Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working keep active This issue is exempt from going stale
Projects
None yet
Development

No branches or pull requests

2 participants