mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-11 03:21:06 +03:30
35 lines
672 B
PHP
Executable File
35 lines
672 B
PHP
Executable File
<?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()])
|
|
);
|
|
}
|
|
}
|