Created
September 20, 2019 10:45
-
-
Save MrAtiebatie/b015d7061619df6507125b027d32b5ef to your computer and use it in GitHub Desktop.
Rendering on demand notifications
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Notifications\AnonymousNotifiable; | |
/* | |
|-------------------------------------------------------------------------- | |
| Web Routes | |
|-------------------------------------------------------------------------- | |
| | |
| Here is where you can register web routes for your application. These | |
| routes are loaded by the RouteServiceProvider within a group which | |
| contains the "web" middleware group. Now create something great! | |
| | |
*/ | |
$router->get('/notification', function () { | |
$user = new AnonymousNotifiable; | |
$notification = (new \App\Notifications\InvoicePaid)->toMail($user->route('mail', ['[email protected]'])); | |
$markdown = new \Illuminate\Mail\Markdown(view(), config('mail.markdown')); | |
return $markdown->render($notification->markdown, $notification->data()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment