array_map(function ($id) use ($filename) {
$keyword = Keyword::find($id)->name;
$filename .= $keyword . '-';
Log::info($filename);
}, $input['keyword_id']);
I want to add the name of keywords to my filename string variable but the values I see in the log is like :
keyword1
keyword2
The output I want is one string as a line.
keyword1keyword2
But as you see, everytime it changes the string instead of appending.