php - How to format email to an array - Laravel 5.2 -
i need send email notification many users. loop through , users email this:
$useremails = $favoriteguides->map(function( $relation ){ return $relation->users->email; });
and result this:
collection {#400 ▼ #items: array:3 [▼ 0 => "fake@hotmail.com" 1 => "fake1@hotmail.com" 2 => "fake3@aol.com" .... , on ] }
i need format goes array can send mail function. needs formatted this:
$emails = ["fake@hotmail.com", "fake2@hotmail.com", "and on..."];
i format result want?
i tried - implode - didnt me result wanted.
use toarray()
method:
$useremails->toarray();
Comments
Post a Comment