Answer the question
In order to leave comments, you need to log in
How to properly include new libraries in Laravel app.php?
Good afternoon.
I connect fpdf and fpdi to the project via composer.json:
"require": {
...
"setasign/fpdf": "^1.8",
"setasign/fpdi": "^2.0"
},
composer update
// config/app.php
return [
//...
'providers' => [
// ...
Setasign\Fpdf\Fpdf::class, // И вот тут я не могу разобраться как правильно прописать
Setasign\Fpdi\src\Fpdi::class,
],
// ...
'aliases' => [
// ...
'Fpdf' => Setasign\Fpdf\Facades\Fpdf::class, // И вот тут я не могу разобраться как правильно прописать
'Fpdi' => Setasign\Fpdi\Facades\Fpdi::class,
]
Answer the question
In order to leave comments, you need to log in
providers and aliases are a provider and a facade for a component that is written for Lara, if you install something that was not written for Lara, then you simply install it with a composer and pull it in the right place:
use Setasign\Fpdf\Fpdf;
$pdf = new Fpdf() ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question