Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No hint path defined for [mail] Laravel 5.4

I am 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.

like image 410
Abdan Syakuro Avatar asked Feb 17 '17 04:02

Abdan Syakuro


3 Answers

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');
}
like image 187
Pete Johnson Avatar answered Nov 16 '22 21:11

Pete Johnson


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');
}
like image 28
Alex Kyriakidis Avatar answered Nov 16 '22 20:11

Alex Kyriakidis


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

app('view')->addNamespace('mail', resource_path('views') . '/mail');
like image 5
Yevgeniy Afanasyev Avatar answered Nov 16 '22 21:11

Yevgeniy Afanasyev