Fluent Strings doesn't work with each() function.
return User::take(2)->get()->each(function(User $user) {
$user->emailOnly = Str::of($user->email)->before('@');
return $user;
});

return User::take(2)->get()->each(function(User $user) {
$user->emailOnly = Str::before($user->email, '@');
return $user;
});

It works fine but you can not use Fluent strings in that fashion.
Take a look in Str class on L50. The of method returns a new Stringable class. On L741 there is a __toString() method.
You should call toString() at the end.
return User::take(2)->get()->each(function(User $user) {
$user->emailOnly = Str::of($user->email)->before('@')->__toString();
return $user;
});
@filkris L108 Before function return string.
Example:
public function index()
{
return Str::of('[email protected]')->before('@');
}
It's work fine without __toString().

You can't compare the 2 exactly the same.
Fluent implements JsonSerializable and Jsonable so the response is converted to json. And since Stringable is an object it return {}.
Stringable by itself just an object. So it got converted to string from the Response object.
See the above.
Thanks guys for explanation. @crynobone @driesvints @filkris