diff --git a/CHANGELOG.md b/CHANGELOG.md index 172e0603..d8d1fac8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ ### Changed - Add lock and unlock task to flow_framework receipe - Updated `artisan:optimize` to run for Laravel 5.7 and above, since [it got added back](https://github.com/laravel/framework/commit/fe1cbdf3b51ce1235b8c91f5e603f1e9306e4f6f) last year. It still doesn't run for 5.5 and below. +- View:clear command to a new view:cache command ### Fixed - Fix rsync upload honor become option for host [#1796] diff --git a/recipe/laravel.php b/recipe/laravel.php index 73eab9f9..08dacf39 100644 --- a/recipe/laravel.php +++ b/recipe/laravel.php @@ -103,9 +103,16 @@ task('artisan:route:cache', function () { run('{{bin/php}} {{release_path}}/artisan route:cache'); }); -desc('Execute artisan view:clear'); -task('artisan:view:clear', function () { - run('{{bin/php}} {{release_path}}/artisan view:clear'); +desc('Execute artisan view:cache'); +task('artisan:view:cache', function () { + $needsVersion = 5.6; + $currentVersion = get('laravel_version'); + + if (version_compare($currentVersion, $needsVersion, '>=')) { + run('{{bin/php}} {{release_path}}/artisan view:cache'); + } else { + run('{{bin/php}} {{release_path}}/artisan view:clear'); + } }); desc('Execute artisan optimize'); @@ -186,7 +193,7 @@ task('deploy', [ 'deploy:vendors', 'deploy:writable', 'artisan:storage:link', - 'artisan:view:clear', + 'artisan:view:cache', 'artisan:config:cache', 'artisan:optimize', 'deploy:symlink',