documentRepo = $documentRepo; } public function get($publicId) { $document = Document::scope($publicId) ->withTrashed() ->firstOrFail(); if(!$this->checkViewPermission($document, $response)){ return $response; } $public_url = $document->getPublicUrl(); if($public_url){ return redirect($public_url); } $response = Response::make($document->getRaw(), 200); $response->header('content-type', $document->type); return $response; } public function postUpload() { if (!Auth::user()->account->isPro()) { return; } if(!$this->checkCreatePermission($response)){ return $response; } $document = Input::all(); $response = $this->documentRepo->upload($document); return $response; } }