rust_floppy
rust_floppy

Reputation: 101

VS Code warning "does not match PSR autoload pattern" but it actually does?

screenshot of the error Class name Slot does not match PSR autoload pattern. It is expected to be slot, or the file name should be Slot.php.

as it says It is expected to be slot, or the file name should be Slot.php and it IS named "Slot.php", I made it with php artisan make:model Slot, just like I did it with Contact and Customer, yet those do not have this problem.

I thought it was just some cached thing, so I did dump-autoload, optimize:clear and even restart VSCode too (several times), but the error still stands. I also went ahead, deleted the file, repeated everything above, then just did php artisan make:model Slot again, but as soon as I open the file, the error comes back...

Even this "premium" feature shows to rename slot.php to Slot.php but it IS already Slot.php, always has been, since the dawn of time (dawn of time = 2 weeks ago).

What am I supposed to do here? This is incredibly frustrating.

PS: I did php artisan make:model foobar/Slots and I don't get the mentioned error on that file (I'm not going to use it like that, just a good to know info). I have absolutely no idea what could be causing this.

php: 8.1

Upvotes: 0

Views: 101

Answers (0)

Related Questions