php 没有为 [mail] Laravel 5.4 定义提示路径
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/42289310/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
No hint path defined for [mail] Laravel 5.4
提问by Abdan Syakuro
hi guys i'm trying to show my markdown email on view, but there's something wrong on my mail view, it shows like
嗨,伙计们,我正在尝试在视图中显示我的降价电子邮件,但是我的邮件视图有问题,它显示为
ErrorException in FileViewFinder.php line 112:
No hint path defined for [mail]. (View: /opt/lampp/htdocs/ppsb_new/core/resources/views/emails/tagihan.blade.php)
and my markdown mail view
和我的降价邮件视图
@component('mail::message')
# TAGIHAN PEMBAYARAN
Berikut tagihan anda untuk pembayaran
@component('mail::button', ['url' => ''])
wut ?
@endcomponent
Gunakan kode tagihan tersebut untuk membayar tagihan.
Thanks,<br>
{{ config('app.name') }}
@endcomponent
and there's also vendor on my views who have their components, pls help me.
并且在我的观点上也有供应商拥有他们的组件,请帮助我。
回答by Pete Johnson
You need to call the markdown()
method in the build()
method of your mailable - not the view()
method. See the example below:
您需要markdown()
在可build()
邮寄的方法中调用该方法- 而不是该view()
方法。请参阅下面的示例:
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->markdown('view-to-mail');
}
回答by Alex Kyriakidis
To use Markdown mailable messages, you have to update the build
method of your Mailable class and instead of view()
, you have to use markdown()
.
要使用 Markdown 可邮寄消息,您必须更新build
Mailable 类的方法,而不是view()
使用markdown()
.
Like this:
像这样:
public function build()
{
return $this->markdown('emails.registered');
}
回答by phil
If you have a View not found issue with laravel mail. After trying the accepted answer and it doesn't work, check yourtemplate.blade.php markdown file and ensure you are not closing @endcomponent
twice without a opening @component
如果您有 Laravel 邮件的未找到视图问题。尝试接受的答案但它不起作用后,请检查 yourtemplate.blade.php markdown 文件并确保您不会在@endcomponent
没有打开的情况下关闭两次@component
回答by Yevgeniy Afanasyev
if you have your email views in ...views/mail, that is how you can specify it:
如果您在 ...views/mail 中有您的电子邮件视图,那么您可以指定它:
app('view')->addNamespace('mail', resource_path('views') . '/mail');
回答by u9179943
I used caffeinated/modules for laravel5.2.
我为 laravel5.2 使用了含咖啡因的/模块。
If you are similar to me you can run this:
如果你和我相似,你可以运行这个:
php artisan module:list
+------+-------+-------+-------------------------------------+----------+
| # | Name | Slug | Description | Status |
+------+-------+-------+-------------------------------------+----------+
| 9001 | Frame | Frame | this is a basic frame for both web. | Disabled |
| 9001 | Index | Index | this is web default index | Enabled |
| 9001 | Admin | Admin | This is admin of meixin project | Enabled |
+------+-------+-------+-------------------------------------+----------+
All right, you can see the disabled option.
好的,您可以看到禁用选项。
php artisan module:enable Frame
Module is already enabled.
模块已启用。
That's all, hope this helps.
就是这样,希望这会有所帮助。