I'm new in Laravel. I was trying to delete some files from public folder of my project. Defined 'delete' function as follow

```
public function delete($id)
{
    $files = File::find($id);
    $filedelete = $files['name'];
    Storage::delete('public/upload/',$filedelete);
    $files->delete();
    return back();
}

```

when I press delete input in my view 

```
<a href="{{ action('FileController@delete',$link['id']) }}" class="btn btn warning">
  <button id="elimina" class="btn btn-danger" type="submit">Elimina</button>
</a>

```

with this route in web.php

```
Route::get('/showFile/{id}/delete',['as'=>'delete', 'uses'=>'FileController@delete']);

```

it gives me this error message

```
unlink(C:\wamp64\www\laravel\[nameproject]\storage\app\public/upload): Permission denied

```

(Trying) to be as clear as possible, I upload a file in a database and in this folder. $id is the primary key of the table where there is the reference of this file. I think my problem is with $files['name'] because if I write the exact name of the file it works. But I need to make this delete dynamic, for sure. I hope to be clear, I'm sorry if not.

Thanks a lot in advance. All the best.

PS With this line in function delete, it works

```
Storage::delete('public/upload/[filename]');

```

Edit

```
$files = File::find($id);
$filedelete = $files['name'];
return "".$filedelete;

```

it returns me the correct name of the file. So, my problem is just how to delete it from that folder?