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

[9.x] Add destroyable singletons #45549

Merged
merged 1 commit into from
Jan 6, 2023
Merged

[9.x] Add destroyable singletons #45549

merged 1 commit into from
Jan 6, 2023

Conversation

axlon
Copy link
Contributor

@axlon axlon commented Jan 6, 2023

This PR aims to create an easy way to mark singleton routes as 'destroyable'. A destroyable singleton may be deleted, but it may not be created (by default). This is useful when its a resource with a default state and deleting it just resets it to that state, or when it is a resource the user cannot create on his own.

Before:

Route::singleton(...)->creatable()->except('create', 'store');

After:

Route::singleton(...)->destroyable();

When singleton routes came out we rewrote our routes to make use of them, but 8.42.2 (6ddf3b0) changed how they worked by not making them not have a destroy action by default anymore, which this PR is trying to solve.

@taylorotwell taylorotwell merged commit b5ad135 into laravel:9.x Jan 6, 2023
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.

2 participants