我们正在向我们的团队频道发送一条松弛消息,因此不使用可通知的实例。我就是这样做的——
Notification::route('slack', env('SLACK_URL'))
->notify(new StaffNotification());
Run Code Online (Sandbox Code Playgroud)
并在 StaffNotification 中
public function toSlack() {
return (new SlackMessage)->content('New Staff Message.');
}
Run Code Online (Sandbox Code Playgroud)
我应该如何测试 StaffNotification,因为所有可用的断言都接受第一个参数作为可通知的?
我目前正在使用 vue2-editor 并导入 quill 模块并按照文档注册它们。但是出现错误 window.Quill 未定义。
我尝试过使用 webpack 插件组合来包含 window.Quill 和 Quill,但错误仍然存在。
在我的 vue 组件中
import { VueEditor } from "vue2-editor";
import { Quill } from "quill";
import { ImageDrop } from "quill-image-drop-module";
import { ImageResize } from "quill-image-resize-module";
Quill.register("modules/imageDrop", ImageDrop);
Quill.register("modules/imageResize", ImageResize);
Run Code Online (Sandbox Code Playgroud)
在我的 webpack 组合中
mix.extend('foo',new class{
webpackPlugins(){
return new webpack.ProvidePlugin({
"window.Quill": "quill/dist/quill.js",
Quill: "quill/dist/quill.js"
});
}
});
Run Code Online (Sandbox Code Playgroud)
未捕获的类型错误:无法读取未定义的属性“导入”
来自 window.Quill.imports
这些是我在控制器中尝试获取图像作为响应的不同方式。
我的图像驻留在public folder/img.
switch ($document->ext) {
case 'doc':
$img = File::get(url('/img/doc.png'));
break;
case 'docx':
$img = File::get(asset('/img/docx.jpg'));
break;
case 'pdf':
$img = File::get(public_path('/img/pdf.png'));
break;
case 'ppt':
$img = File::get(url(public_path('/img/ppt.png')));
break;
default:
}
return new Response($img, 200);
Run Code Online (Sandbox Code Playgroud)