/** * 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(); }
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' => 'تبلیغات در پروفایل']); }
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(); }