Skip to content

Instantly share code, notes, and snippets.

@alfredoem
Last active November 3, 2015 19:21
Show Gist options
  • Save alfredoem/75d90d706771cc2421d3 to your computer and use it in GitHub Desktop.
Save alfredoem/75d90d706771cc2421d3 to your computer and use it in GitHub Desktop.
Controller for a pdf example
<?php namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
class AlohaController extends Controller
{
public function getPdf()
{
$view = view('pdf.example')->render();
$pdf = app('dompdf.wrapper');
$pdf->loadHTML($view);
return $pdf->stream('invoice');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment