// store it
Context::put('currentTeam', Request::user()->teams->first());
// get it
$currentTeam = Context::get('currentTeam');
// store it
context('currentTeam', request()->user()->teams->first());
// get it
$currentTeam = context('currentTeam');
namespace App\Http\Middleware;
use Closure;
class StoreTeamRequestContext
{
public function handle($request, Closure $next)
{
$request->context()->put('currentTeam', $request->user()->teams()->first());
return $next($request);
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.