1Route::get('mail-preview', function () {
2 return (new MyNotification())->toMail($some_user);
3});
4
1<?php
2
3namespace App\Models;
4
5use Illuminate\Broadcasting\PrivateChannel;
6use Illuminate\Foundation\Auth\User as Authenticatable;
7use Illuminate\Notifications\Notifiable;
8
9class User extends Authenticatable
10{
11 use Notifiable;
12
13 /**
14 * The channels the user receives notification broadcasts on.
15 *
16 * @return string
17 */
18 public function receivesBroadcastNotificationsOn()
19 {
20 return 'users.'.$this->id;
21 }
22}