예제 #1
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'));
 }
예제 #2
0
 /**
  * upload images.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function upload()
 {
     //
     $data = Album::lists('name', 'id');
     return view('image.upload', ['types' => $data]);
 }