Just copy it from one to the other. Assuming the Digital ocean disk is named "do"
Storage::disk('do')->put(
$filename,
Storage::disk('local')->get($localPath)
);
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello Everybody,
I've succesfully built a livewire component which upload multiple images to local storage. Now, I would like to move the uploaded files from the local storage to Digital Ocean Spaces and i thought to do so :
Now I'm facing issue in retrieving the image from local storage inside the job.
To retrieve the image inside the job I'm doing :
$img=Storage::get(local_storage_path)
But when i try to dd($img) i get :
Ï Ó\x00\x10JFIF\x00\x01\x01\x01\x01,\x01,\x00\x00 █\x00C\x00\x02\x01\x01\x02\x01\x01\x02\x02\x02\x02\x02\x02\x02\x02\x03\x05\x03\x03\x03\x03\x03\x06\x04\x04\x03\x05\x07\x06\x07\x07\x07\x06\x07\x07\x08\t\v\t\x08\x08\x08\x07\x07\v\f\f\f\f\x07\t\x0E\x0F\f\x0E\v\f\f\f █\x00C\x01\x02\x02\x02\x03\x03\x03\x06\x03\x03\x06\f\x08\x07\x08\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f\f └\x00\x11\x08\t\x1E¼\x03\x01"\x00\x02\x11\x01\x03\x11\x01 ─\x00\x1E\x00\x01\x00\x00\x06\x03\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x05\x06\x07\x08\t\x01\x02\x03 ─\x00o\x10\x00\x01\x03\x02\x03\x04\x04\x05\v\v\x0F\v\x02\x03\x02\x0F\x00\x01\x02\x03\x04\x05\x06\x07\x11\x08\x12!1\x13AQa\t"qüæ\x14\x152BRVôí▒Ð\x16\x17\x18#SUbrÆ┴Ê\x19346CTsuéöò▓│Ëß\x1A$578WctvûóÁ%9Dâ┤┬údä±&'eÈ(Ef├ÔÒ ─\x00\x1D\x01\x01\x00\x01\x04\x03\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\x03\x04
a lot of characters.
My question is, how do i correctly retrieve the image from local storage in order to process it in the job? Hope somebody can help me.
Thank you.
Please or to participate in this conversation.