SHARE
TWEET

Untitled

a guest May 27th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         $startsWithArgs = "";
  2.         $changeToOpts   = "";
  3.  
  4.         Attachment::chunk(100, function ($attachments) use ($startsWithArgs, $changeToOpts) {
  5.             foreach($attachments AS $attachment) {
  6.                 if (starts_with($attachment->file_uri, $startsWithArgs)) {
  7.                     $newURI = $changeToOpts. explode($startsWithArgs, $attachment->file_uri)[1];
  8.                     $attachment->update([
  9.                         'file_uri' => $newURI
  10.                     ]);
  11.                 }
  12.             }
  13.         });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top