Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera uno-de-piera/form.blade.php Secret
Last active Jun 10, 2019

What would you like to do?
<div class="card">
<div class="card-body">
@if ($errors->any())
<div class="alert alert-danger">
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
{{ Form::model($course, ['url' => route('upload_s3'), 'files' => true]) }}
<div class="form-group">
{{ Form::label('Imagen', null, ['class' => 'control-label']) }}
{{ Form::file('upload') }}
<div class="form-group btn.purple">
{{ Form::submit('Subir archivo') }}
{{ Form::close() }}
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Storage;
Route::post('upload', function () {
$file = request()->file('upload');
$upload = Storage::disk('s3')->put('courses/' . $file->getClientOriginalName(), $file, 'public');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.