Home Controller

materi 6
 avatar
user_3285855
php
7 months ago
618 B
2
Indexable
Never
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Models\Keuangan;
use PDF;

class HomeController extends Controller
{
    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('auth');
    }

    /**
     * Show the application dashboard.
     *
     * @return \Illuminate\Contracts\Support\Renderable
     */
    public function index()
    {
        $keuangan = Keuangan::all();
        $pdf = PDF::loadview('dashboard.report', ['keuangan' => $keuangan]);

        return $pdf->stream();
    }
}
Leave a Comment