belongsTo(CountryModel::class, 'country_id', 'id'); } // 根据id查询 public function scopeId($query, $value) { $query->where('id', '=', $value); } }