Laravel 5.8执行php artisan vendor:publish --tag=laravel-mail显示成功却未生成邮件视图
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 theresources/views/vendordirectory 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/viewsAfter 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:clearThen try
php artisan vendor:publish --tag=laravel-mailagain.Verify Vendor Directory Files Exist
Double-check if the source templates actually exist in your vendor folder. Navigate tovendor/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-devThis 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 entireviewsfolder fromvendor/laravel/framework/src/Illuminate/Mail/resources/toresources/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

