I am using with Laravel and trying to add user content via a middleware. I have followed the direction on github and mocked an error and no user content was sent.
Here is my middleware:
<?php
namespace App\Http\Middleware;
use Closure;
class SentryContext
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if (app()->bound('sentry')) {
/** @var \Raven_Client $sentry */
$sentry = app('sentry');
$sentry->user_context([
'firstname' => $request->firstname,
'lastname' => $request->lastname,
]);
}
return $next($request);
}
}
Any thoughts on what I may be doing wrong?