HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
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']);
    }

}