I'm trying to send a notification email as follows:
$post= Post::findOrFail($id);
$user = new User(['email' => '[email protected]']);
$user->notify(new ReportPost($post));
But this isn't working for some reason. No error, but I'm not receiving any email. But if I fetch a user from the database and try the same thing, it will work. Any idea?
I'm using Lumen 5.3 and I've included the Mail and Notification package from Laravel 5.3
You will need to install
illuminate/notificationsas Lumen does not support notifications out of the boxmore can be found at https://stevethomas.com.au/php/using-laravel-notifications-in-lumen.html