I have a problem with email's views with Laravel. This is how I send a mail:
$user = $bet->user; // A bet hasOne user. All is ok here
Mail::queue('emails.betWon', array('user' => $user), function($message) use ($user)
{
$message->to($user->email)->subject('Tu as remporté un pari !');
});
This is my view emails.betWon
:
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8">
</head>
<body>
{{ var_dump($user) }}
</body>
</html>
And this is the mail I get:
array (size=3)
'timestamps' => boolean false
'incrementing' => boolean true
'exists' => boolean true
Which is not a User object...