{{-- Pass in: $model - The model instance this belongs to, e.g: ['model' => $airport] $redirect - Where to go to --}}

files

{{-- Show all the files here --}} @if(count($model->files)) @endif @foreach($model->files as $file) @endforeach
Name Current File
{{ $file->name }} Link to file {{ Form::open(['route' => ['admin.files.delete', $file->id], 'method' => 'delete']) }} {{ Form::hidden('id', $file->id) }} {{ Form::hidden('redirect', $redirect) }} {{ Form::button('', [ 'type' => 'submit', 'class' => 'btn btn-sm btn-danger btn-icon', 'onclick' => "return confirm('Are you sure?')"]) }} {{ Form::close() }}

{{ Form::open([ 'url' => route('admin.files.store'), 'method' => 'POST', 'class' => 'form-inline', 'files' => true ]) }} {{-- Fields for the model --}} {{ Form::hidden('ref_model', get_class($model)) }} {{ Form::hidden('ref_model_id', $model->id) }} {{ Form::hidden('redirect', $redirect) }} {{ Form::label('name', 'Name:') }} * {{ Form::text('name', null, ['class' => 'form-control']) }} {{ Form::file('file', ['class' => 'form-control']) }} {{ Form::submit('Upload', ['class' => 'btn btn-success']) }}

{{ $errors->first('name') }}

{{ $errors->first('file') }}

{{ Form::close() }}