feat: complete upgrade media-library packages

This commit is contained in:
amir-ys
2024-11-08 02:16:34 +03:30
parent ff8db13621
commit 50c261678f
5 changed files with 204 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
<?php
namespace App\Console\Commands;
use App\Services\Media\Media;
use Illuminate\Console\Command;
use Illuminate\Support\Str;
class AddUUIDToMedia extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'app:add-uuid-to-media';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Execute the console command.
*/
public function handle()
{
Media::query()->cursor()->each(
fn(Media $media) => $media->update(['uuid' => Str::uuid()])
);
}
}