Laravel Context: The Hidden Information That Follows Your Code
When working with Laravel, we usually pass data explicitly: $user = auth () -> user (); UserExampleService :: process ( $user ); Or we add information directly to a log: Log :: info ( 'Processing order' , [ 'order_id' => $order -> id , ]); But what if you have some information that should be available throughout the current execution? For example: a trace ID the current URL a tenant ID an…
We haven't written up this one. Dev.to has the full story — the link below goes straight to it.