src/Mgallegos/DecimaFile/File/Services/FileManagement/FileManager.php
public function servePrivateFile($key)
  {
    $File = $this->File->byKeyAndPublic($key , false)->first();

    if(!is_null($File))
    {
      return $this->serveFile($File->system_type, $File->system_route, $File->name);
    }

    return $this->Redirector->to($this->AppManager->getErrorPageUrl())->withError($this->Lang->get('decima-file::file-management.fileNotFound'));
  }
public function servePrivateFile($key)
  {
    $File = $this->File->byKeyAndPublic($key , false)->first();

    if(!is_null($File))
    {
      return $this->serveFile($File->system_type, $File->system_route, $File->name);
    }

    return $this->Redirector->to($this->AppManager->getErrorPageUrl())->withError($this->Lang->get('decima-file::file-management.fileNotFound'));
  }
public function servePrivateFile ( $ key ) { $ File = $ this -> File -> byKeyAndPublic ( $ key , false ) -> first ( ) ; if ( ! is_null ( $ File ) ) { return $ this -> serveFile ( $ File -> system_type , $ File -> system_route , $ File -> name ) ; } return $ this -> Redirector -> to ( $ this -> AppManager -> getErrorPageUrl ( ) ) -> withError ( $ this -> Lang -> get ( 'decima-file::file-management.fileNotFound' ) ) ; }
Serve private file

@param string $key

@return Response
Serve private file