You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Laravel 5.8执行php artisan vendor:publish --tag=laravel-mail显示成功却未生成邮件视图

Troubleshooting Laravel 5.8 Mail Component Publish Issue

Hey, I’ve dealt with this exact frustrating problem before in Laravel 5.8—where the publish command says it succeeded but no files show up. Let’s go through the most likely fixes:

  • Check File Permissions
    This is the #1 culprit. Laravel needs write access to the resources/views/vendor directory to copy the mail templates. Run these commands (adjust the user/group if you’re on a different environment like MAMP/WAMP):

    chmod -R 755 resources/views
    chown -R www-data:www-data resources/views
    

    After setting permissions, re-run the publish command.

  • Clear Configuration Cache
    Sometimes cached config files can mess with the publish command’s path resolution. Clear the cache first:

    php artisan config:clear
    

    Then try php artisan vendor:publish --tag=laravel-mail again.

  • Verify Vendor Directory Files Exist
    Double-check if the source templates actually exist in your vendor folder. Navigate to vendor/laravel/framework/src/Illuminate/Mail/resources/views—if this folder is empty or missing, your Composer install might be incomplete. Fix it with:

    composer dump-autoload
    composer install --no-dev
    

    This will refresh your dependencies and ensure the mail views are present.

  • Manual Copy (As a Last Resort)
    If none of the above works, skip the publish command entirely. Just manually copy the entire views folder from vendor/laravel/framework/src/Illuminate/Mail/resources/ to resources/views/vendor/mail. This bypasses any publish command quirks and gets you the templates directly.

I’ve used all these fixes at one point or another, and usually one of them resolves the "success but no files" issue.

内容的提问来源于stack exchange,提问作者Suhadak Akbar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.14 08:53:58