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

files

@component('admin.components.info') Add a download link or upload a file to make available @endcomponent
@if(count($model->files) === 0) @include('admin.common.none_added', ['type' => 'files']) @endif {{-- Show all the files here --}} @if(count($model->files)) @endif @foreach($model->files as $file) @endforeach
Name Direct Link Downloads
{{ $file->name }} Link to file {{$file->download_count}} {{ Form::open(['route' => ['admin.files.delete', $file->id], 'method' => 'delete']) }} {{ Form::hidden('id', $file->id) }} {{ 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 ]) }} {{ Form::token() }} * {{ Form::text('file_name', null, ['class' => 'form-control', 'placeholder' => 'Name']) }} {{ Form::text('file_description', null, ['class' => 'form-control', 'placeholder' => 'Description']) }} {{ Form::text('url', null, ['class' => 'form-control', 'placeholder' => 'URL']) }} {{ Form::file('file', ['class' => 'form-control']) }} {{-- Fields for the model --}} {{ Form::hidden('ref_model', get_class($model)) }} {{ Form::hidden('ref_model_id', $model->id) }} {{ Form::submit('Save', [ 'id' => 'save_file_upload', 'class' => 'btn btn-success' ]) }}
{{ $errors->first('filename') }} {{ $errors->first('url') }} {{ $errors->first('file') }}
{{ Form::close() }}