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

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -