Exploring Runtime Request Inspection in Laravel (Guards, Contexts, and Tradeoffs)
dev.to·5d·
Discuss: DEV
💻PHP Development
Preview
Report Post

Exploring runtime request inspection in Laravel

I’ve been experimenting with a Laravel package that inspects requests during runtime, not just before the controller is hit.

This started as a question rather than a solution:

Can runtime context inside the framework give better security signals than static request inspection?

So I decided to prototype it.


Core idea

Instead of relying only on:

  • validation rules
  • middleware checks
  • edge security (WAF, CDN rules)

The package builds a RuntimeContext once the request is already inside Laravel and runs a pipeline of Guards against it.

Each guard inspects a different aspect of the request or behavior.


Architecture (high level)

RuntimeContext

  • Normalized request data
  • Headers, body, …

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help