Manually attach package to Laravel (unable to use composer due to firewall)
<p>I can't use composer to handle my dependencies due to the corporate firewall. At the moment I'm trying to use <a href="https://github.com/barryvdh/laravel-dompdf" rel="nofollow">Barry vd Heuvel's DomPDF wrapper for Laravel</a> and tried to:</p>

<ol>
<li>Download the zipfile from Github (master)</li>
<li>Updated <code>composer.json</code> (not sure if its needed, but did it anyway) and added <code>"barryvdh/laravel-dompdf": "*"</code> in the <code>require</code> container.</li>
<li>Create the folder structure: <code>vendor/barryvdh/laravel-dompdf</code></li>
<li>Place all files from the package in there (<code>config</code>-folder, <code>src</code>-folder and the files <code>.gitignore</code>, <code>composer.json</code> and <code>readme.md</code>)</li>
<li>Add the service provider and facade in my <code>app.php</code>. Service provider is listed as <code>Barryvdh\DomPDF\ServiceProvider::class</code> and the facade is aliased like <code>'PDF' =&gt; Barryvdh\DomPDF\Facade::class</code></li>
<li>Ran <code>composer dump-autoload</code></li>
</ol>

<p>After refreshing the browser I'm getting <code>Class 'Barryvdh\DomPDF\ServiceProvider' not found</code>. I also tried to run <code>php artisan cache:clear</code> and <code>php artisan dump-autoload</code> but the last one fails over the fact it can't find <code>Barryvdh\DomPDF\ServiceProvider</code>.</p>

<p>What have I forgotten to do to make it work?</p>

<p><strong>Update</strong>
I've tried the suggested answer from Wouter J and the composer.json now looks like:</p>

<pre><code>..
"autoload": {
    "classmap": [
      "database"
    ],
    "psr-4": {
      "App\\": "app/",
      "Barryvdh\\DomPDF\\": "vendor/barryvdh/laravel-dompdf/src"
    },
..
</code></pre>

<p>I've verified if the composer dump-autoload had any effect but I think it had. Because the entry is now also listed in <code>vendor/composer/autoload_psr4.php</code> like:</p>

<pre><code>return array(
 // more entries
 'Barryvdh\\DomPDF\\' =&gt; array($vendorDir . '/barryvdh/laravel-dompdf/src'),
 'App\\' =&gt; array($baseDir . '/app'),
);
</code></pre>

<p>I believe at this point this is working, but the Facade isn't responding. When I try to call something like <code>PDF::loadView(...)</code> and I let PhpStorm import the class (<code>vendor/barryvdh/laravel-dompdf/src/PDF.php</code>) it throws an error I can't call the method loadView statically. According to the documentation I should be able to call it like this:</p>

<pre><code>$pdf = PDF::loadView('pdf.invoice', $data);
return $pdf-&gt;download('invoice.pdf');
</code></pre>

<p>But that results in <code>Non-static method Barryvdh\DomPDF\PDF::loadView() should not be called statically, assuming $this from incompatible context</code> on my end. </p>

<p>Suggestions?</p>