public function scopeVacant($query) { $ids = \App\Visit::lists('bed_id'); //dd($ids); $beds = $query->select(\DB::raw("CONCAT(bed_type,'bed type : ',floor,'th floor ',section,' section ',rate_per_night, 'per night' ) AS full_name, id"))->whereNotIn('id', $ids)->lists('full_name', 'id'); return $beds; }