When on delete i want to delete not only row from the table, i also want to delete file from the public path. This is my code:
public function destroy($id)
{
$photo = Photo::find($id);
Storage::delete(public_path('/photos/' . $photo->photo));
$photo->delete();
return back();
}
Can some one tell me what im doing wrong?
i use Illuminate\Support\Facades\Storage;
Also i use Intervention\Image\ImageManagerStatic as Image;
for storing photo.