Closed pxpm closed 8 months ago
You need to install Laravel Spark before you may use the middleware.
@jbrooksuk maybe I am missing something, and sorry if that's the case. But is Spark now a Laravel dependency ?
I just created a new Laravel application using the above mentioned command: composer create-project laravel/laravel:"dev-master" laravel11
Care to re-open or please clarify? This spark alias came with the framework.
Thanks in advance. 🙏
Unable to replicate the issue with just composer create-project laravel/laravel:"dev-master" laravel11
Unable to replicate the issue with just
composer create-project laravel/laravel:"dev-master" laravel11
Thanks for your time @crynobone
I've updated https://github.com/laravel/framework/pull/50304#issuecomment-1969608513 with my findings.
It's the VSCode PHP Intellisense (static analysis) that wrote those errors on my log file when indexing project files.
While on this process, the error pops up in the logs.
To reproduce it, you just need to force your editor to re-index project files.
What annoys me is that I spent quite some time trying to debug this thing, I just saw it on my laravel.log
file. No complete stacktrace, no way to reproduce it.
And the solution is to move the alias registration to spark package. I don't get the "convenience" in this case because you need to install spark anyway to use it. So why not have the alias when you install spark and remove it from framework code?
Cheers
Laravel Version
11
PHP Version
8.2
Database Driver & Version
sqlite
Description
The middleware is referenced here: https://github.com/laravel/framework/blob/7c680bb58dfb15923209045f99ed5cf46c31f45d/src/Illuminate/Foundation/Configuration/Middleware.php#L739
I am not sure about the fix, or if there is something to fix other than removing that alias. If it were to fix, maybe checking if the class exists before pushing it to router in https://github.com/laravel/framework/blob/7c680bb58dfb15923209045f99ed5cf46c31f45d/src/Illuminate/Foundation/Http/Kernel.php#L456 ? 🤷
Cheers
Steps To Reproduce
just a fresh laravel instalation with:
composer create-project laravel/laravel:"dev-master" laravel11