Invoice PDF rendering

This commit is contained in:
Deon George
2018-08-01 23:29:16 +10:00
parent c444e1d218
commit 46db6537d6
7 changed files with 210 additions and 206 deletions

View File

@@ -5,6 +5,7 @@ namespace App\Http\Controllers;
use Illuminate\Support\Facades\Auth;
use App\Models\Invoice;
use App\User;
use PDF;
class UserHomeController extends Controller
{
@@ -18,6 +19,11 @@ class UserHomeController extends Controller
return View('invoice',['o'=>$o]);
}
public function invoice_pdf(Invoice $o)
{
return PDF::loadView('invoice', ['o'=>$o])->stream(sprintf('%s.pdf',$o->invoice_account_id));
}
public function home()
{
switch (Auth::user()->role()) {