Exemplo n.º 1
0
 public function getVer($id) {
     $data['ficha'] = \App\Ficha::findOrFail($id);
     $data['jugador'] = $data['ficha']->jugador;
     $data['representante'] = $data['ficha']->representante;
     $data['club'] = $data['ficha']->club;
     $data['posicion'] = $data['ficha']->posicion;
     return View::make('fichas.planilla', $data);
 }
Exemplo n.º 2
0
 public function getImagen($id)
 {
     $ficha = Ficha::findOrFail($id);
     $mimetype = array('gif' => 'image/gif', 'png' => 'image/png', 'jpg' => 'image/jpeg');
     $content = NULL;
     $mime = NULL;
     foreach ($mimetype as $ext => $type) {
         if (Storage::has('fichas/' . $ficha->id . "." . $ext)) {
             $content = Storage::get('fichas/' . $ficha->id . "." . $ext);
             $mime = $type;
             break;
         }
     }
     if ($content == NULL) {
         abort(404);
     }
     return response($content)->header('Content-Type', $mime)->header('Content-Disposition', 'attachment')->header('filename', $ficha->numero . '.pdf');
 }