The issue is that you are trying to cast a method which is not a column that is wrong if you want to cast or change the result to array use this approch
$yourModel->skills->toArray()
And lastly, the problem with it returning one result is that it's trying to fetch a row using the Skill model that matches the model id assuming the Skill have the id as primary_key; there will only be one element in that table in skills table that matches YourModel id that was the reason that was returning 1 data, to correct that, remove the id and replace it with the foreign_key For more reference, use this link: laravel doc
public function skills(){
return $this->hasMany(Skill::class,'foreign_key');
}