Membership
This commit is contained in:
parent
37cb2b06c7
commit
21abafb8db
51 changed files with 1549 additions and 493 deletions
|
|
@ -22,10 +22,18 @@ class Subdomain
|
|||
{
|
||||
$tld = config('app.tld_care');
|
||||
if(!empty($request->route('subdomain'))){
|
||||
$user_shop = UserShop::where('slug', $request->route('subdomain'))->where('active', 1)->first();
|
||||
//sub.mivita.care
|
||||
$user_shop = UserShop::where('slug', $request->route('subdomain'))->first();
|
||||
$request->route()->forgetParameter('subdomain');
|
||||
Util::setPostRoute('user/');
|
||||
if($user_shop){
|
||||
|
||||
if(!$user_shop->active){
|
||||
abort(503);
|
||||
}
|
||||
if(!$user_shop->user->isActiveShop()){
|
||||
abort(503);
|
||||
}
|
||||
\Session::put('user_shop', $user_shop);
|
||||
\Session::put('user_shop_domain', config('app.protocol').$user_shop->slug.".".config('app.domain').config('app.tld_care'));
|
||||
|
||||
|
|
@ -33,8 +41,9 @@ class Subdomain
|
|||
return $next($request);
|
||||
}
|
||||
}else{
|
||||
//mivita.shop
|
||||
$tld = config('app.tld_shop');
|
||||
$user_shop = UserShop::where('slug', 'aloevera')->where('active', 1)->first();
|
||||
$user_shop = UserShop::where('slug', 'aloevera')->first();
|
||||
//$request->route()->forgetParameter('subdomain');
|
||||
Util::setPostRoute('user/');
|
||||
if($user_shop){
|
||||
|
|
@ -44,10 +53,8 @@ class Subdomain
|
|||
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return redirect(config('app.url'). $tld);
|
||||
return redirect(config('app.url') .$tld);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue