mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-12 06:21:10 +03:30
feat: complete upgrade media-library packages
This commit is contained in:
Executable
+34
@@ -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()])
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user