Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
- Simple, fast routing engine.
- Powerful dependency injection container.
- Multiple back-ends for session and cache storage.
- Expressive, intuitive database ORM.
- Database agnostic schema migrations.
- Robust background job processing.
- Real-time event broadcasting.
Laravel is accessible, powerful, and provides tools required for large, robust applications.
Laravel has the most extensive and thorough documentation and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
If you don't feel like reading, Laracasts can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
First Install package by following this package link and follow its step. Next is to downlaod fonts from this bangla fonts website link. After Completing this step you will keep your font file inside project/vendor/mpdf/mpdf/src/Config/FontVariables.php and open FontVariables.php and search for 'indics' ,then after pothana2000 ,add follwoing code
"nikosh" => ['R' => "Nikosh.ttf",'useOTL' => 0xFF,]
You are done completing this step.
Create a view file ready in your laravel resource folder for pdf. after completing this step then in controller
To use Laravel Mpdf add something like this to one of your controllers. You can pass data to a view in /resources/views
.
//....
class ReportController extends Controller {
public function generate_pdf()
{
$mpdf = new \Mpdf\Mpdf([
'default_font_size' => 12,
'default_font' => 'nikosh'
]);
$mpdf->writeHTML(view('printpdf'));
$mpdf->output();
}
}
Add some faker data
@php
$membeid = json_decode($member->cat_id, true);
$num_count = 0;
$num_of_items = count($membeid);
@endphp
@foreach($membeid as $key => $cat)
{{ App\Category::getinfo($cat) }}
@php $num_count = $num_count + 1; @endphp
@if($num_count < $num_of_items)
@php echo ", "; @endphp
@endif
@endforeach