-
-
Save uno-de-piera/0f1a0010b1abf17ca9c7abfc0705f51b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@section('content') | |
<div class="card"> | |
<div class="card-body"> | |
@if ($errors->any()) | |
<div class="alert alert-danger"> | |
<ul> | |
@foreach ($errors->all() as $error) | |
<li>{{ $error }}</li> | |
@endforeach | |
</ul> | |
</div> | |
@endif | |
{{ Form::model($course, ['url' => route('upload_s3'), 'files' => true]) }} | |
<div class="form-group"> | |
{{ Form::label('Imagen', null, ['class' => 'control-label']) }} | |
{{ Form::file('upload') }} | |
</div> | |
<div class="form-group btn.purple"> | |
{{ Form::submit('Subir archivo') }} | |
</div> | |
{{ Form::close() }} | |
</div> | |
</div> | |
@stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
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'); | |
})->name('upload_s3'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment