No hint path defined for [mail] Laravel 5.4

前端 未结 6 2127
时光取名叫无心
时光取名叫无心 2020-12-10 10:24

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          


        
相关标签:
6条回答
  • 2020-12-10 10:31

    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');
    }
    
    0 讨论(0)
  • 2020-12-10 10:35

    Try using a custom email view template, like this:

    You received a message from : {{ $name }}
    
    <p>
    Name: {{ $name }}
    </p>
    
    <p>
    Email: {{ $email }}
    </p>
    
    <p>
    Message: {{ $user_message }}
    </p>
    
    0 讨论(0)
  • 2020-12-10 10:40

    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.

    0 讨论(0)
  • 2020-12-10 10:43

    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

    0 讨论(0)
  • 2020-12-10 10:52

    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');
    }
    
    0 讨论(0)
  • 2020-12-10 10:52

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

    app('view')->addNamespace('mail', resource_path('views') . '/mail');
    
    0 讨论(0)
提交回复
热议问题