I want to simply increment a column for each download but it adds 2 or more instead of 1. Here is my code:
public function download(Music $music)
{
$music->increment('downloads');
$file=$music->getFilePath();
return response()->download($file,$music->title);
}
However, if I remove response()->download... line it works correctly. What's the problem and how to solve it?
[update]
IDM issue. Can be solved by separating increment and download routes.