How use Laravel of concat with pluck method?
Some time we need concat multiple fields with pluck function in laravel
Here we describe how use multiple columns in pluck function use of concat
public function get_course()
{
$course_type = $_GET['course_type'];
$courseArray = DB::table('courses')->where(['status' => 0, 'course_type' => $course_type])
->orderBy('name', 'asc')
->pluck(DB::raw('CONCAT(name," -->",duration_in_month, " Months") AS name'),'id');
return json_encode($courseArray);
}