Code variables type declaration

This commit is contained in:
BrettonYe
2025-01-01 14:49:14 +08:00
parent b5628a4ab9
commit 08d20d07b8
56 changed files with 694 additions and 795 deletions

View File

@@ -3,20 +3,19 @@
namespace App\Http\Controllers;
use App\Models\NotificationLog;
use Illuminate\Contracts\View\View;
use Illuminate\Mail\Markdown;
class MessageController extends Controller
{
public function index(string $type, string $msgId)
public function index(string $type, string $msgId): View
{
if ($type === 'markdown') {
$log = NotificationLog::whereMsgId($msgId)->latest()->firstOrFail();
$title = $log->title;
$content = Markdown::parse($log->content)->toHtml();
//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;
return view('components.message', compact('title', 'content'));
//}
}
}