MessageController.php 516 B

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