Files
ProxyPanel/app/Http/Controllers/MessageController.php
2024-09-04 22:45:34 +08:00

23 lines
543 B
PHP

<?php
namespace App\Http\Controllers;
use App\Models\NotificationLog;
use Illuminate\Mail\Markdown;
class MessageController extends Controller
{
public function index(string $type, string $msgId)
{
if ($type === 'markdown') {
$log = NotificationLog::whereMsgId($msgId)->latest()->firstOrFail();
$title = $log->title;
$content = Markdown::parse($log->content)->toHtml();
return view('components.message', compact('title', 'content'));
}
return false;
}
}