code: public function stream(Media $model)
      {
          return response()->stream(function() use ($model) {
              $stream = $model->stream();
  
              fpassthru($stream);
  
              if (is_resource($stream)) {
                  fclose($stream);
              }
          });
      }
docs: Stream
  
  @param Media $model
  @return mixed