/** * Handle the event. * * @param shopPurchased $event * @return void */ public function handle(shopPurchased $event) { $payment = $event->payment; $shop = $payment->itemable; $payment->update(['status' => 1]); $shop->update(['status' => 1]); File::makeDirectory(public_path() . '/img/files/shop/' . $shop->id, 0775, true, true); Addon::shop()->first()->buy(); }
public function shop(Request $request) { $user = Auth::user(); $shop = Addon::shop()->first(); $shop->comments()->create(['user_id' => $user->id, 'body' => $request->input('body')]); $shop->update(['num_comment' => $shop->comments()->count()]); Flash::success('comment sent'); return redirect()->back(); }
public function shop() { $user = Auth::user(); $shop = Addon::shop()->first(); return view('store.shop', compact('user', 'shop'))->with(['title' => 'فروشگاه ساز']); }