예제 #1
0
 /**
  * Handle the event.
  *
  * @param  showcasePurchased  $event
  * @return void
  */
 public function handle(showcasePurchased $event)
 {
     $payment = $event->payment;
     $showcase = $payment->itemable;
     $payment->update(['status' => 1]);
     $showcase->update(['status' => 1]);
     Addon::showcase()->first()->buy();
 }
예제 #2
0
 public function showcase(Showcase $vitrin)
 {
     $user = $vitrin->user;
     $profile = $vitrin->profile;
     $visit_rate = $profile->info->num_visit / (Carbon::parse($profile->created_at)->month + 1);
     $showcase = Addon::showcase()->first();
     $price = $this->showcasePrice($profile);
     return view('store.showcase', compact('user', 'profile', 'showcase', 'visit_rate', 'price', 'vitrin'))->with(['title' => 'تبلیغات در پروفایل']);
 }
예제 #3
0
 public function showcase(Request $request)
 {
     $user = Auth::user();
     $showcase = Addon::showcase()->first();
     $showcase->comments()->create(['user_id' => $user->id, 'body' => $request->input('body')]);
     $showcase->update(['num_comment' => $showcase->comments()->count()]);
     Flash::success('comment sent');
     return redirect()->back();
 }