Laravel PDF Report
Step 1
Run command on command prompt
composer require barryvdh/laravel-dompdf

Step 2
Open Config->app.php

Add the below text in Service provider List

Add the below text in Alise List

'PDF' => Barryvdh\DomPDF\Facade::class,

Step 3
Create Controller by artisan command

php artisan make:controller Mypdf_controller

Create Index function

namespace App\Http\Controllers;
use Illuminate\Http\Request;
use PDF;
use DB;
class Mypdf_controller extends Controller
public function index()
$students = DB::table('users')->get();
$pdf=PDF::loadView('pdf_home',['students' => $students]);
return $pdf->download('customer.pdf');

Step 4
Create Route

Step 5
Create View
save page as pdf_home.blade.php

View Student Records

<title>View Student Records</title>
<table border='1'>
@foreach ($students as $student)
<td>{{ $student->name }}</td>
<td>{{ $student->email }}</td>


Now Run Url with getpdf