Fix Illegal string offset 'function' on morphToMany

Fix for bug https://github.com/laravel/framework/issues/3558 and also incorrect variable name inside of belongsToMany method.