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

files

@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 ]) }} {{-- Fields for the model --}} {{ Form::hidden('ref_model', get_class($model)) }} {{ Form::hidden('ref_model_id', $model->id) }} * {{ Form::text('filename', null, ['class' => 'form-control', 'placeholder' => 'Name']) }} {{ Form::text('file_description', null, ['class' => 'form-control', 'placeholder' => 'Description']) }} {{ Form::file('file', ['class' => 'form-control']) }} {{ Form::submit('Upload', ['class' => 'btn btn-success']) }}
{{ $errors->first('filename') }} {{ $errors->first('file') }}
{{ Form::close() }}