Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.x] Allow exceptions to the optimize and optimize:clear commands #54070

Open
wants to merge 3 commits into
base: 11.x
Choose a base branch
from

Conversation

jonerickson
Copy link

Summary

This PR introduces the --except option to the optimize and optimize:clear commands, enabling greater flexibility in managing optimization tasks. This change allows developers to integrate with these commands while providing control over which specific tasks are executed or skipped.

Use Case

In applications deployed on Laravel Vapor, route caching is unsupported. By leveraging the --except option, we can utilize the optimize command without triggering unsupported operations like route:cache.

Examples

// Skip by command name
php artisan optimize --except route:cache

 // Skip by key
php artisan optimize --except route

// Skip by comma delimited list of keys or command names
php artisan optimize:clear --except route,view:cache

New Help

Screenshot 2025-01-03 at 9 09 16 AM

Feedback

Welcome to input on strategy or additional use cases this feature could support.

@jonerickson jonerickson marked this pull request as draft January 3, 2025 17:16
Copy link

github-actions bot commented Jan 3, 2025

Thanks for submitting a PR!

Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

@jonerickson jonerickson marked this pull request as ready for review January 8, 2025 06:23
@jonerickson jonerickson changed the title Allow exceptions to the optimize and optimize:clear commands [11.x] Allow exceptions to the optimize and optimize:clear commands Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant