factory = $factory; $this->user = $user; } /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { Config::set('setup',$x=Setup::find(config('app.id'))->load('system')); $this->factory->share('user',$this->user); $this->factory->share('setup',$x); return $next($request); } }