No hint path defined for [mail] Laravel 5.4

不问归期 提交于 2019-11-27 05:54:10

问题


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.


回答1:


You need to call the markdown() method in the build() method of your mailable - not the view() method. See the example below:

/**
 * Build the message.
 *
 * @return $this
 */
public function build()
{
    return $this->markdown('view-to-mail');
}



回答2:


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().

Like this:

public function build()
{
    return $this->markdown('emails.registered');
}



回答3:


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




回答4:


if you have your email views in ...views/mail, that is how you can specify it:

app('view')->addNamespace('mail', resource_path('views') . '/mail');



回答5:


I used caffeinated/modules for 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.



来源:https://stackoverflow.com/questions/42289310/no-hint-path-defined-for-mail-laravel-5-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!