@php use App\Models\Document; $file=Document::find($id); if (isset($file->getMedia()[0])) { $url=$file->getMedia()[0]->getUrl(); } else{ $url=""; } @endphp {!! Form::open(['route' => ['document.destroy', $id], 'method' => 'delete']) !!}
{!! Form::button('', [ 'type' => 'submit', 'class' => 'btn btn-danger', 'onclick' => "return confirm('Are you sure?')" ]) !!}
{!! Form::close() !!}