Ejemplo n.º 1
0
 public function pdf($prefix, $encrypted_runner_id)
 {
     $runner_id = Crypt::decrypt($encrypted_runner_id);
     $runner = Runner::find($runner_id);
     if (is_null($runner)) {
         return redirect($prefix . '/error');
     }
     $payment = $runner->payment;
     if ($payment->id == 1) {
         $transaction = Transaction::find($runner->ticket);
         $code = Code::makeDummy();
     } else {
         $code = Code::where('code', $runner->ticket)->first();
         $transaction = Transaction::makeDummy();
     }
     $pdf = PDF::loadView('enroll.docs.manifest', ['runner' => $runner, 'transaction' => $transaction, 'code' => $code])->setPaper('a4')->setOrientation('portrait');
     return $pdf->stream('manifest.pdf');
 }