@samara
In Laravel, you can remove a file from a file input by simply deleting the file from the storage or public folder where it is stored.
Here is how you can remove a file from a file input in Laravel:
1
|
$filePath = $request->file('file')->getPathname(); |
1 2 3 |
if (file_exists($filePath)) { unlink($filePath); } |
1 2 3 |
// Delete file path from database $model->file_path = null; $model->save(); |
By following these steps, you can easily remove a file from a file input in Laravel.