Skip to content

Commit b21b2ac

Browse files
authored
Merge pull request #18032 from grokability/move-asset-private-files
Added migration to move asset model private uploads
2 parents 549928d + 1396c59 commit b21b2ac

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Support\Facades\Storage;
5+
6+
return new class extends Migration
7+
{
8+
/**
9+
* Run the migrations.
10+
*/
11+
public function up(): void
12+
{
13+
14+
$assetmodelfiles = Storage::allFiles('private_uploads/assetmodels');
15+
16+
foreach ($assetmodelfiles as $file) {
17+
Storage::writeStream('private_uploads/models/' . basename($file),
18+
Storage::readStream($file)
19+
);
20+
}
21+
}
22+
23+
/**
24+
* Reverse the migrations.
25+
*/
26+
public function down(): void
27+
{
28+
//
29+
}
30+
};

0 commit comments

Comments
 (0)