Fixing Eloquent query