Fixes a bug with Eloquent results in templates