title: notification on new user registration
body: <p>I used two tutorials to create code which notifies me on a new user registration. <a href="http://laraveldaily.com/mail-notifications-customize-templates/" rel="nofollow noreferrer">mail-notifications</a> and <a href="http://laraveldaily.com/redirect-login-register-add-method/" rel="nofollow noreferrer">redirect-login-register-add-method/</a></p>
  
  <h3>This works now</h3>
  
  <p>I am just sending a notification to default email defined here in my <code>User</code> model:</p>
  
  <h3>This is my desired goal</h3>
  
  <p>I want to send newly registered user's email in the emailed notification. Also, I wish to customize recipient for this specific <code>HelloUser</code> notification. </p>
  
  <pre><code>public function routeNotificationForMail()
  {
      return 'name@gmail.com';
  }
  </code></pre>
  
  <p>The notification is fired by the code in my <code>RegisterController.php</code>:</p>
  
  <pre><code>protected function redirectTo()
  {
      $user = Auth::user();
      $user-&gt;notify(new \App\Notifications\HelloUser());
      return '/'; // redirects to main page
  }
  </code></pre>
  
  <p>The above solution works, but I after many attempts I am still unable to get these extended result:</p>
  
  <h2>to do 1</h2>
  
  <p>I will have several notifications, which I want to mail to 2-3 emails, not just one. </p>
  
  <h3>My attempt</h3>
  
  <p>In my notification file <code>App\Notifications\\HelloUser.php</code> I tried to add
  extra line. (Note tha the line is now commented)</p>
  
  <pre><code>public function toMail($notifiable)
  {
      return (new MailMessage)
                  -&gt;line('The introduction to the notification.')
                  -&gt;action('Notification Action', url('/'))
                  -&gt;line('The new user email is ');
                  // -&gt;to('name@gmail.com');
  }
  </code></pre>
  
  <p>... but I failed. I could define global recipient as described <a href="https://laravel.com/docs/5.5/notifications#customizing-the-recipient" rel="nofollow noreferrer">here in the documentation</a></p>
  
  <h3>My question #1</h3>
  
  <p>How I can I define a separate recipient for each <code>Notification</code>?</p>
  
  <h2>TO DO 2</h2>
  
  <p>I also tried to get the newly registered user's email into the emailed notification. 
  For this purpose I tried to copy my solution from <code>Mailables</code>. So in <code>RegisterControler.php</code> I tried to pass $user variable in the function:</p>
  
  <pre><code>protected function redirectTo()
  {
      $user = Auth::user();
      $user-&gt;notify(new \App\Notifications\HelloUser($user));
      return '/';
  }
  </code></pre>
  
  <p>and then in my <code>Notification</code> file <code>App\Notifications\HelloUser</code> I did this:</p>
  
  <pre><code>public $user;
  
  public function __construct($user)
  {
      $email = $user-&gt;email;
  }
  </code></pre>
  
  <p>in a hope that this piece would produce a notification with new user's email:</p>
  
  <pre><code>public function toMail($notifiable)
  {
      return (new MailMessage)
                  -&gt;line('The introduction to the notification.')
                  -&gt;action('Notification Action', url('/'))
                  -&gt;line('The new user email is '.$user-&gt;email);
  }
  </code></pre>
  
  <p>The result: I just get <code>Undefined variable: user</code>.</p>
  
  <h2>TO DO</h2>
  
  <p>How to make this code work?</p>
  
  <p>Thank you for your time. </p>
  
  <p>=============
  Edit:
  upon @Arun_jai request I place here the dd($notifiable). It seems that it is generated properly and the object is just instance of the <code>User</code> model. The relevant part:</p>
  
  <pre><code> #attributes: array:6 [▼
  "name" =&gt; "Peter attempt 16"
  "email" =&gt; "name@gmail.com"
  "password" =&gt; "$2t9WHLFY14XNf0$nj7TYDYAxiZ/kdfrUy$1vC2"
  "updated_at" =&gt; "2018-01-18 07:08:12"
  "created_at" =&gt; "2018-01-18 07:08:12"
  "id" =&gt; 270
  ]
  </code></pre>