public function store(Request $request, User $user, ShopManager $shopManager) { $this->validate($request, ['name' => 'required']); $shopManager->createShop($user, $request->only('name')); $this->flashSuccess('add'); return redirect()->route('admin::shops.index'); }
public function postForm(Request $request, ShopManager $shopManager) { return $this->error('暂时不开放'); $this->validate($request, ['terms' => 'accepted', 'name' => 'required']); $shop = $shopManager->createShop($this->user(), $request->all()); $this->dispatchNow(new StubNewShop($shop)); $this->getShopReauthLimiter($request)->pass(); $this->flashSuccess(trans('shop::messages.welcome')); return redirect()->route('shop::home', $shop->id); }
public function index() { $shops = $this->shopManager->getShopRepository()->latest('updated_at')->paginate(); return view('shop::__admin.shops.index', compact('shops')); }