public function index() { $streams = StreamMapper::byClient($this->user); $orders = BannerMapper::activeClient($this->user); $inactiveBanners = BannerMapper::inactiveClient($this->user); return view('app.pages.user.client.stream.index', compact('streams', 'orders', 'inactiveBanners')); }
public function show($userId) { $user = User::find($userId); if (!$user) { return Redirect::back()->withErrors(['user' => 'No such user']); } $banners = []; if ($user->type == 'client') { $banners = BannerMapper::activeClient($user); } if ($user->type == 'twitcher') { $banners = BannerMapper::activeTwitcher($user); } return view('admin.pages.user.show', compact('user', 'banners')); }