Laravel artisan serve #246
mark-win
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
This is the way to do it with via a middleware, do not forget the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I got this to work in a local Laravel dev environment and wanted to share how I did it.
Running on Ubuntu, I created the following
/etc/php/8.3/mods-available/spx.ini
Then I created a link, to enable it in cli:
As
artisan serve
is long running,spx.profiling_auto_start
is disabled in the ini and needs to be handled manually by code. So I created a middleware, that triggers in local environment.This is then registered in
App\Http\Kernel::$middleware
as the first entry.Depending on your needs, it might be wise to check for a custom env var, or even make it a group middleware to have more control over the profiled routes.
php artisan serve
can be called as usual and the web panel can be reached as expected:http://localhost:8000/?SPX_KEY=dev&SPX_UI_URI=/
.@NoiseByNorthwest thank you for the great tool!
Beta Was this translation helpful? Give feedback.
All reactions