Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $startsWithArgs = "";
- $changeToOpts = "";
- Attachment::chunk(100, function ($attachments) use ($startsWithArgs, $changeToOpts) {
- foreach($attachments AS $attachment) {
- if (starts_with($attachment->file_uri, $startsWithArgs)) {
- $newURI = $changeToOpts. explode($startsWithArgs, $attachment->file_uri)[1];
- $attachment->update([
- 'file_uri' => $newURI
- ]);
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement