I have a variable, called $applicants and it contains data from users table and other tables from eager load.
Something like this:
Then I pass that variable to a Laravel Notification class via __construct method. The problem is if I dd the $applicant in the __construct method, the data is preserved, but if I dd it in the toMail method, it only contains data from user table.
Here is the code:
class DailyReportWasGenerated extends Notification implements ShouldQueue {
use Queueable;
private $applicants;
/**
* Create a new notification instance.
*
* @param $applicants
*/
public function __construct($applicants)
{
$this->applicants = $applicants;
dd($this->applicants->toArray());
}
public function toMail($notifiable)
{
dd($this->applicants->toArray());
}
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/385BjKm
via IFTTT


Aucun commentaire:
Enregistrer un commentaire