public function approved(Showcase $showcase, Request $request) { if ($showcase->approved == 1) { $showcase->update(['approved' => 0]); } elseif ($showcase->approved == 0) { $showcase->update(['approved' => 1]); $this->approvedStream($showcase); } return redirect()->back(); }
public function showcaseBuy(Request $request, Showcase $showcase) { $this->validate($request, ['payment_gate' => 'required|in:pasargad,mellat']); $user = $showcase->user; $profile = $showcase->profile; $price = $this->showcasePrice($profile); $price = round($price - $price * Config::get('addonShowcase.discount')); $callback = route('store.showcase.buy.callback'); $description = 'تبلیغات در 7روفایل'; $order = $showcase->payment()->create(['user_id' => $user->id, 'amount' => $price, 'description' => $description, 'gateway' => $request->input('payment_gate'), 'status' => 0]); $orderId = $order->id; $this->pay($price, $callback, $orderId, $description, $request->input('payment_gate')); }
/** * Remove the screenshot image. * * @param \Illuminate\Http\Request $request * @param string $id * @return \Illuminate\Http\Response */ public function screenshotsRemove(Request $request, $id) { $showcase = Showcase::findOrFail($id); $file = $request->get('s'); foreach ($showcase->screenshots as $s) { if ($s == $file) { if ($showcase->pull('screenshots', $s)) { $this->deleteImage($s); } } } return back(); }
/** * Make showcase application is draft mode. * * @param int $id * @return Response */ public function draft($id) { $app = Showcase::findOrFail($id); $app->published = 'd'; if ($app->save()) { session()->flash('success', 'Showcase App is successfully draft.'); } else { session()->flash('error', 'Error occured to draft the showcase app.'); } return redirect()->route('showcase'); }