1

I'm trying to pull data from folder so that a user can download it I'm trying something like this

{!! Html::link('public/{{$file->name}}', '{{$file->name}}') !!}

but it throws out this

 <?php echo e($file->name); ?>
 <?php echo e($file->name); ?>

Is it possible to combine those two and how can it be done

Controller part

public function download($file_name){
    $file_path = public_path('/'.$file_name);
    return response()->download($file_path);
}

It calls this error

NotFoundHttpException in RouteCollection.php line 161:
in RouteCollection.php line 161
at RouteCollection->match(object(Request)) in Router.php line 821
at Router->findRoute(object(Request)) in Router.php line 691

User will need to be able download different kind of files img/pdf/doc/xls.

OunknownO
  • 1,186
  • 3
  • 21
  • 41

1 Answers1

2

You don't nest blade within blade. You just do it once.

{!! Html::link('public/'.$file->name, $file->name) !!}

Blade will handle the parsing from there.

Ohgodwhy
  • 49,779
  • 11
  • 80
  • 110