1
0

MessageController.php 550 B

123456789101112131415161718192021
  1. <?php
  2. namespace App\Http\Controllers;
  3. use App\Models\NotificationLog;
  4. use Illuminate\Contracts\View\View;
  5. use Illuminate\Mail\Markdown;
  6. class MessageController extends Controller
  7. {
  8. public function index(string $type, string $msgId): View
  9. {
  10. //if ($type === 'markdown') {
  11. $log = NotificationLog::whereMsgId($msgId)->latest()->firstOrFail();
  12. $title = $log->title;
  13. $content = Markdown::parse($log->content)->toHtml();
  14. return view('components.message', compact('title', 'content'));
  15. //}
  16. }
  17. }