Exemplo n.º 1
0
 /**
  * Get a list of currencies
  *
  * @return static
  */
 public function getList()
 {
     $currencies = $this->currency->all();
     $response = $currencies->map(function ($item) {
         return ["id" => $item->id, "name" => $item->name, "exchange_rate" => $this->money->fromStoredMoney($item->exchange_rate)];
     });
     return $response;
 }
 public function index()
 {
     $data = Company::with('currency')->get();
     $currency = Currency::all();
     $timezones = Common::timezone();
     return view('companies.list', ['data' => $data, 'currency' => $currency, 'timezones' => $timezones]);
 }
Exemplo n.º 3
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int $id
  * @return Response
  */
 public function edit($id)
 {
     $tags = Tag::lists('name', 'id');
     $albums = Album::lists('name', 'id');
     $event = Event::findOrFail($id);
     $prices = $event->prices->toArray();
     $arr = array();
     foreach ($prices as $price) {
         $p = array();
         $p['name'] = $price['name'];
         $p['amount'] = $price['amount'];
         array_push($arr, $p);
     }
     $event['hiddenprice'] = json_encode($arr);
     $currencies = Currency::all();
     $event = $event->formatEvent();
     if ($event->banner_id == null) {
         $event['bannerid'] = '';
         $event['bannername'] = '';
     } else {
         $event['bannerid'] = $event->banner_id;
         $event['bannername'] = $event->banner->name;
     }
     if ($event->start == null) {
         $event['daterange'] = '';
     } else {
         $event['daterange'] = $event->start->format('d/m/Y H:s') . ' - ' . $event->end->format('d/m/Y H:s');
     }
     return view('admin.event.edit', compact('event', 'tags', 'albums', 'currencies'));
 }
Exemplo n.º 4
0
 /**
  * @param $currency
  *
  * @return mixed
  */
 static function getCurrency($currency)
 {
     $list = Currency::all()->last();
     return $list->{$currency};
 }
Exemplo n.º 5
0
 public function getCurrencies()
 {
     return json_decode(Currency::all());
 }