Skip to content

[9.x] Add destroyable singletons - #45549

Merged
taylorotwell merged 1 commit into
laravel:9.xfrom
axlon:destroyable-singletons
Jan 6, 2023
Merged

[9.x] Add destroyable singletons#45549
taylorotwell merged 1 commit into
laravel:9.xfrom
axlon:destroyable-singletons

Conversation

@axlon

@axlon axlon commented Jan 6, 2023

Copy link
Copy Markdown
Contributor

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