Skip to content

Instantly share code, notes, and snippets.

@preyneyv
Created August 2, 2019 02:48
Show Gist options
  • Select an option

  • Save preyneyv/d2d217a593355dd9b10bd26165246a0f to your computer and use it in GitHub Desktop.

Select an option

Save preyneyv/d2d217a593355dd9b10bd26165246a0f to your computer and use it in GitHub Desktop.

File Upload using Laravel.

This is very easy.

In config/filesystems.php,

  // ...
  // Change 'local' path to this:
  'local' => [
    'driver' => 'local',
    'root' => public_path(),
  ],
  // ...

And use it as

$path = $request->file('image')->store('images')

The file will get stored in public/images/<something>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment