Solution:
first()
will return only that particular column but wrapped in a Book
object anyway, so use pluck()
instead:
$single_data = Book::
selectRaw("GROUP_CONCAT(DISTINCT CAST(id as char) SEPARATOR ',') as type_id_list")
->pluck('type_id_list');