Closed C0chett0 closed 1 year ago
Hi.
Sure !
In the default migration file you import both Illuminate\Database\Schema\Blueprint and Illuminate\Support\Facades\Schema which are both unused in the file. But not importing the Illuminate\Support\Facades\DB which is actually used, making the migration crash when trying to run it.
Thanks, can confirm those imports are unused.
Can you paste the error message and stack trace? DB
seems to autoload for me on a fresh app.
Well I'll be damned it is indeed autoloaded.
But both my IDE (VSCode with intelephense) and a few tools (phpstan and php-cs-fixer) still complain about the missing use when not present.
I let you decide if you want to remove the import since it runs fine without it. But my two cents would be to keep it since I (along with my friends VSCode, phpstan and php-cs-fixer) see it as a best practice to explicitly import needed classes.
Good to know, let's keep it.
Hi @C0chett0, can you give some context on this change?