/** * Show the form for editing the specified resource. * * @param int $id * @param CountryRepository $countries * @return Response */ public function edit($id, CountryRepository $countries) { try { $country = $countries->findById($id); return view('countries.edit')->with('model', $country); } catch (ModelNotFoundException $e) { flash()->warning(trans('countries.not_found')); return redirect()->route('country.index'); } }
public function view(Request $request, GenderRepository $genderRepo, CountryRepository $countryRepo) { return view('website.customer.account')->with(['browserTitle' => trans('website.my_account'), 'mainArea' => 'account', 'genders' => $genderRepo->getAll(), 'countries' => $countryRepo->getList(), 'customer' => $this->customer->getByToken()]); }
/** * Execute the command. * * @param CountryRepository $countries * @return Country */ public function handle(CountryRepository $countries) { $country = $countries->findById($this->id)->fill($this->getProperties()); $countries->save($country); return $country; }
public function handle(MandrillMail $mailer, OrderRepository $repository, CountryRepository $country) { $payment_kind_slugs = config('shop.payment_kind_slugs'); $payment_kind_slug = $payment_kind_slugs[$this->order->payment_kind_id]; $countries = $country->getList(); $template = email_template('order_confirmation', config('app.locale')); $subject = str_replace('{order-number}', $this->order->order_number, $template['subject']); $body = markdown_text($template['body']); $body = str_replace('{name}', $this->order->invoice_first_name . ' ' . $this->order->invoice_last_name, $body); $body = str_replace('{order-number}', $this->order->order_number, $body); $order_details = ''; $total = 0; if ($this->order->order_products) { foreach ($this->order->order_products as $order_product) { $complete_price = $order_product->quantity * $order_product->price_brut; $total += $complete_price; $order_details .= $order_product->quantity . " x " . $order_product->product_collection . " // " . $order_product->product_variant . " // " . $order_product->product_color . "\r" . trans('order.single_price') . ": " . convert_from_cents($order_product->price_brut) . " € // " . trans("shop.complete_price") . ": " . convert_from_cents($complete_price) . " €<hr>"; } } $order_details .= trans('shop.price_sum') . ": " . convert_from_cents($total) . " €<hr>"; $order_details .= trans('shop.shipping_costs') . ": " . convert_from_cents(config('shop.default_shipping_cost')) . " €<hr>"; $order_details .= "<strong>" . trans('shop.total') . ": " . convert_from_cents(config('shop.default_shipping_cost') + $total) . " €</strong><hr><br><br>"; $order_details .= trans('checkout.remarks') . ":<br>" . nl2br($this->order->remarks) . "<br><br>"; if ($this->mode == 'self') { if ($this->order->paypal_transaction_id) { $order_details .= $this->order->paypal_transaction_id . "<br>"; } if ($this->order->stripe_token_id) { $order_details .= $this->order->stripe_token_id . "<br>"; } } $order_details .= trans('order.order_number') . ": " . $this->order->order_number . "<br>"; $order_details .= trans('shop.payment_kind') . ": " . $this->order->payment_kind->name . "<br><br>"; $body .= $order_details; $email_description = str_replace('{total}', convert_from_cents(config('shop.default_shipping_cost') + $total) . ' €', $this->order->payment_kind->email_description); $email_description = str_replace('{order-number}', $this->order->order_number, $email_description); $payment_details = $email_description . "<br><br>"; if ($payment_kind_slug == 'prepayment') { $payment_details .= markdown_settings('bank_account') . "<br><br>"; } $body .= $payment_details; $account_details = trans('shop.invoice_address') . ":<br>" . $this->order->invoice_first_name . " " . $this->order->invoice_last_name . "<br>"; $account_details .= $this->order->invoice_street . "<br>" . $this->order->invoice_zip . " " . $this->order->invoice_city . "<br>"; $account_details .= $countries[$this->order->invoice_country_id] . "<br><br>"; $account_details .= trans('shop.shipping_address') . ":<br>" . $this->order->shipping_first_name . " " . $this->order->shipping_last_name . "<br>"; $account_details .= $this->order->shipping_street . "<br>" . $this->order->shipping_zip . " " . $this->order->shipping_city . "<br>"; $account_details .= $countries[$this->order->shipping_country_id] . "<br><br>"; $body .= $account_details; if ($this->mode != 'self') { $legal = ""; $legal .= "<br><br><div class='small'><em>" . trans('order.right_of_withdrawal_note') . "</em><br>"; $legal .= markdown_settings('right_of_withdrawal'); $legal .= "<br><em>" . trans('order.end_of_right_of_withdrawal_note') . "</em></div><br><br>"; $body .= $legal; /* $terms = ""; $terms .= "<br><br><div class='small'>"; $terms .= markdown_settings('terms'); $terms .= "</div><br><br>"; $body .= $terms; */ } $html_content = $body; $to_emails = [$this->order->invoice_email]; if ($this->mode == 'self') { $to_emails = explode(',', settings('order_email_addresses')); } foreach ($to_emails as $to_email) { $message = ['subject' => $subject, 'inline_css' => true, 'merge' => true, 'merge_language' => 'handlebars', 'preserve_recipients' => false, 'global_merge_vars' => array(['name' => 'maincontent', 'content' => $html_content])]; $message['to'] = [['email' => $to_email, 'type' => 'to']]; $mandrill_responses = MandrillMail::messages()->sendTemplate('order-confirmation', '', $message); } }
/** * Execute the command. * * @param CountryRepository $countries * @return Paginator */ public function handle(CountryRepository $countries) { return $countries->query($this->query); }
/** * Show the form for creating a new resource. * * @param App\Repositories\CountryRepository $countryRepository * @return Response */ public function create(CountryRepository $countryRepository) { $countries = $countryRepository->getAllSelect(); return view($this->base . '.create', compact('countries')); }
/** * Execute the command. * * @param CountryRepository $countries * @return Country */ public function handle(CountryRepository $countries) { $country = Country::register($this->iso_code_2, $this->name); $countries->save($country); return $country; }
public function getEdit(Request $request, GenderRepository $genderRepo, CountryRepository $countryRepo) { $id = last_part_of_url($request->path()); $producer = $this->producer->getById($id); return view('website.customer.producers.edit')->with(['browserTitle' => str_replace('{wildcard}', $producer->last_name, trans('producer.edit_producer_wildcard')), 'mainArea' => 'producers', 'subArea' => 'edit', 'countries' => $countryRepo->getList(), 'genders' => $genderRepo->getAll(), 'producer' => $producer]); }
/** * Show the form for creating a new resource. * * @param CarrierRepository $carriers * @param CountryRepository $countries * @return Response */ public function create(CarrierRepository $carriers, CountryRepository $countries) { return view('shipping-rules.create')->with('carriers', $carriers->all())->with('countries', $countries->all()); }