config() public static method

public static config ( $key, $default = null )
Ejemplo n.º 1
0
 /**
  * Upload a remote file into storage.
  *
  * @param string $url    The url to the remote file to upload.
  * @param string $target The path to the file to store.
  *
  * @return bool
  */
 public function remoteUpload($url, $target)
 {
     $tmp_name = md5($url);
     $tmp_path = Storage::config('tmp_path') . '/' . $tmp_name;
     if (!$this->remoteDownload($url, $tmp_path)) {
         return false;
     }
     return $this->upload($tmp_path, $target);
 }
Ejemplo n.º 2
0
<?php

use Dmyers\Storage\Storage;
if ($route_path = Storage::config('route_path', false)) {
    // Register storage route.
    \Route::get($route_path . '{path}', function ($path) {
        try {
            $response = Storage::render($path);
        } catch (\Exception $e) {
            \App::abort(404, 'File not found');
        }
        return $response;
    });
}