/**
  * 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);
 }
Exemplo n.º 2
0
 /**
  * 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();
 }
Exemplo n.º 3
0
/**
 * 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);
}
Exemplo n.º 4
0
 /**
  * Handle invalidated auth.
  *
  * @param \Illuminate\Http\Request $request
  *
  * @return mixed
  */
 protected function invalidated($request)
 {
     return redirect()->route('shop::login.get', shopId());
 }