예제 #1
0
파일: activeShop.php 프로젝트: emadmrz/Hawk
 /**
  * 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();
 }
예제 #2
0
 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();
 }
예제 #3
0
 public function shop()
 {
     $user = Auth::user();
     $shop = Addon::shop()->first();
     return view('store.shop', compact('user', 'shop'))->with(['title' => 'فروشگاه ساز']);
 }