一键导入
push-alert
Push and manage alerts in the session or bag for rendering.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Push and manage alerts in the session or bag for rendering.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | push-alert |
| description | Push and manage alerts in the session or bag for rendering. |
Use this skill when you need to add an alert to the current request's bag, handle conditional alert pushing, or manage persistent alerts that last across multiple requests.
Use the push() static method to create and add an alert to the bag in one go.
MyAlert::push(['body' => 'Operation successful']);
Use pushWhen() or pushUnless() to add an alert only if a condition evaluates to true or false.
MyAlert::pushWhen($request->user()->hasVerifiedEmail(), ['body' => 'Verified!']);
Make an alert persistent using persistAs($key). It will remain in the session until manually abandoned using abandon($key).
// Persist
MyAlert::push(['body' => 'System maintenance'])->persistAs('maintenance');
// Abandon
MyAlert::abandon('maintenance');
Use make() to create an instance without adding it to the bag, then use pushToBag() when ready.
$alert = MyAlert::make(['body' => 'Wait for it...']);
// ... logic ...
$alert->pushToBag();