koel/database/factories/AlbumFactory.php
2021-07-26 23:21:36 +02:00

22 lines
465 B
PHP

<?php
namespace Database\Factories;
use App\Models\Album;
use App\Models\Artist;
use Illuminate\Database\Eloquent\Factories\Factory;
class AlbumFactory extends Factory
{
protected $model = Album::class;
/** @return array<mixed> */
public function definition(): array
{
return [
'artist_id' => Artist::factory(),
'name' => $this->faker->colorName,
'cover' => md5(uniqid()) . '.jpg',
];
}
}