mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-10-25 11:09:17 +01:00
32 lines
685 B
PHP
32 lines
685 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Database\Seeders\List\Playlist;
|
|
|
|
use App\Actions\Models\AssignHashidsAction;
|
|
use App\Models\List\Playlist;
|
|
use Illuminate\Database\Seeder;
|
|
use Illuminate\Support\Collection;
|
|
|
|
/**
|
|
* Class PlaylistHashidsSeeder.
|
|
*/
|
|
class PlaylistHashidsSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function run(): void
|
|
{
|
|
Playlist::query()
|
|
->chunkById(100, fn (Collection $playlists) => $playlists->each(function (Playlist $playlist) {
|
|
$action = new AssignHashidsAction();
|
|
|
|
$action->assign($playlist, 'playlists');
|
|
}));
|
|
}
|
|
}
|