File: D:/HostingSpaces/SBogers10/ridderstee.komma.pro/app/Komma/Downloads/DownloadController.php
<?php
namespace Komma\Downloads;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Response;
use Komma\Kms\Documents\Models\Document;
class DownloadController extends Controller
{
public function getDocument($slug)
{
$document = Document::where('slug', $slug)
->with('file')
->has('file')
->first();
if(empty($document)) \App::abort(404);
dd($document->file->path);
return Response::make($document->file->path, 200, ['content-type' => 'application/pdf']);
}
}