Last active
November 3, 2015 19:21
-
-
Save alfredoem/75d90d706771cc2421d3 to your computer and use it in GitHub Desktop.
Controller for a pdf example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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