php - Manually attach package to Laravel (unable to use composer due to firewall) -
i can't use composer handle dependencies due corporate firewall. @ moment i'm trying use barry vd heuvel's dompdf wrapper laravel , tried to:
- download zipfile github (master)
- updated
composer.json
(not sure if needed, did anyway) , added"barryvdh/laravel-dompdf": "*"
inrequire
container. - create folder structure:
vendor/barryvdh/laravel-dompdf
- place files package in there (
config
-folder,src
-folder , files.gitignore
,composer.json
,readme.md
) - add service provider , facade in
app.php
. service provider listedbarryvdh\dompdf\serviceprovider::class
, facade aliased'pdf' => barryvdh\dompdf\facade::class
- ran
composer dump-autoload
after refreshing browser i'm getting class 'barryvdh\dompdf\serviceprovider' not found
. tried run php artisan cache:clear
, php artisan dump-autoload
last 1 fails on fact can't find barryvdh\dompdf\serviceprovider
.
what have forgotten make work?
update i've tried suggested answer wouter j , composer.json looks like:
.. "autoload": { "classmap": [ "database" ], "psr-4": { "app\\": "app/", "barryvdh\\dompdf\\": "vendor/barryvdh/laravel-dompdf/src" }, ..
i've verified if composer dump-autoload had effect think had. because entry listed in vendor/composer/autoload_psr4.php
like:
return array( // more entries 'barryvdh\\dompdf\\' => array($vendordir . '/barryvdh/laravel-dompdf/src'), 'app\\' => array($basedir . '/app'), );
i believe @ point working, facade isn't responding. when try call pdf::loadview(...)
, let phpstorm import class (vendor/barryvdh/laravel-dompdf/src/pdf.php
) throws error can't call method loadview statically. according documentation should able call this:
$pdf = pdf::loadview('pdf.invoice', $data); return $pdf->download('invoice.pdf');
but results in non-static method barryvdh\dompdf\pdf::loadview() should not called statically, assuming $this incompatible context
on end.
suggestions?
composer autoload still doesn't know how download package. have configure autoloading this:
{ "autoload": { "psr-4": { "namespace\\of\\the\\package\\": "vendor/the/package" } } }
Comments
Post a Comment