Skip to content

[7.x] Add $unique argument to Asset::move() - #14364

Merged
jasonvarga merged 1 commit into
statamic:masterfrom
lwekuiper:feat/asset-move-unique-arg
Mar 30, 2026
Merged

[7.x] Add $unique argument to Asset::move()#14364
jasonvarga merged 1 commit into
statamic:masterfrom
lwekuiper:feat/asset-move-unique-arg

Conversation

@lwekuiper

@lwekuiper lwekuiper commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

This is a follow-up to #14236, which added Asset::moveUnique() as a non-breaking addition for 6.x.

Since master allows breaking changes, this PR removes moveUnique() and adds a $unique parameter directly to Asset::move(), consistent with how Asset::rename() already works:

$asset->move('folder', 'filename', unique: true);

@lwekuiper lwekuiper changed the title [master] Add $unique argument to Asset::move() [7.x] Add $unique argument to Asset::move() Mar 26, 2026

@jasonvarga jasonvarga left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First v7 PR! 🎉

I've just brought master up to date with 6.x if you'd like to fix the conflicts and remove the moveUnique method. (or reopen the PR if that's easier for you)

@lwekuiper
lwekuiper force-pushed the feat/asset-move-unique-arg branch from 53edf63 to 4b7a508 Compare March 26, 2026 14:28
@lwekuiper
lwekuiper requested a review from jasonvarga March 26, 2026 14:58
@lwekuiper

Copy link
Copy Markdown
Contributor Author

First v7 PR! 🎉

That's actually pretty cool 🥳 The PR is now updated!

@jasonvarga jasonvarga left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a bunch of unnecessary formatting changes. (e.g. added newlines, renaming unrelated test methods with_events->withEvents).

The moveQuietly method also needs the $unique parameter. Technically it works because it forwards arguments but it should be added.

Remove moveUnique() in favor of a $unique parameter on move(),
consistent with how rename() already works. Add $unique parameter
to moveQuietly() signature for explicit API parity.
@lwekuiper
lwekuiper force-pushed the feat/asset-move-unique-arg branch from 4b7a508 to 5c35199 Compare March 30, 2026 08:51
@lwekuiper

lwekuiper commented Mar 30, 2026

Copy link
Copy Markdown
Contributor Author

Right, that was my automatic Pint formatting, I'll make sure future PRs don't include this.

This is now cleaned up and the $unique parameter is added to moveQuietly().

@lwekuiper
lwekuiper requested a review from jasonvarga March 30, 2026 09:06
@jasonvarga

Copy link
Copy Markdown
Member

Thanks!

@jasonvarga
jasonvarga merged commit 8c478d0 into statamic:master Mar 30, 2026
17 checks passed
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