Roboroads / laravel-tinker

Adds a way to write php and run it directly in Laravels' Artisan Tinker.
Apache License 2.0
211 stars 15 forks source link

Issues with PHPStorm Version 2023.1.5 Build #PS-231.9414.10 build on February 14,2024 Fatal error: Uncaught Error: Class "Illuminate\Support\Facades\DB" not found in /in/0g7nB:5 #333

Closed mydidefix closed 6 months ago

mydidefix commented 6 months ago

Short bug description

The Database: Larvel 9.5 Query Builder not working

Extended bug description

Fatal error: Uncaught Error: Class "Illuminate\Support\Facades\DB" not found in /in/0g7nB:5 Stack trace:

0 {main}

thrown in /in/0g7nB on line 5
Process exited with code 255.

Your project is not the problem

How to reproduce?

Trying to retrieve data from the users table. you get an error.

Expected behavior

The query of the users table should work. It used to work as well.

Screenshots

No response

IDE & Version

PHPStorm 2023.1.5

PHP Version

PHP 8.0.13

OS and version

OS

Laravel Tinker plugin version

2.6.1

Interpreter type

Local

Laravel Version

versions : * v9.52.16

Tinker version

Psysh version

Additional Context

The problem did not exist before laravel update. I was able to access Laravel DB Query without any problems. Fatal error: Uncaught Error: Class "Illuminate\Support\Facades\DB" not found in /in/0g7nB:5 Stack trace:

0 {main}

thrown in /in/0g7nB on line 5
Process exited with code 255.

Many thanks for the great module. mfg Dieter

Roboroads commented 6 months ago

thrown in /in/0g7nB

Looks like you're not running your code through the tinker plugin. Are you using the tinker action to run your code? Check the FAQ