/** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { $reauthLimier = $this->getShopReauthLimiter($request); if ($reauthLimier->check()) { return redirect()->route('shop::home', shopId()); } return $next($request); }
/** * Bootstrap the application services. * * @return void */ public function boot() { Link::macro('shopRoute', function ($route, $text) { return Link::route($route, $text, [shopId()]); }); Link::macro('sellerRoute', function ($route, $text, $params = []) { return Link::to(sellerRoute($route, $params), $text); }); $this->registerUserMenu(); $this->registerShopMenu(); $this->registerAdminMenu(); }
/** * Automatically provide the shop parameter to shop routes * * @param $route * @param array $parameters * @return string */ function shopRoute($route, $parameters = []) { return route('shop::' . $route, ['currentShop' => shopId()] + (array) $parameters); }
/** * Handle invalidated auth. * * @param \Illuminate\Http\Request $request * * @return mixed */ protected function invalidated($request) { return redirect()->route('shop::login.get', shopId()); }