koel/database/factories/AlbumFactory.php

23 lines
494 B
PHP
Raw Normal View History

<?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;
2020-12-22 20:11:22 +00:00
/** @return array<mixed> */
public function definition(): array
{
return [
'artist_id' => Artist::factory(),
'name' => ucwords($this->faker->words(random_int(2, 5), true)),
2020-12-22 20:11:22 +00:00
'cover' => md5(uniqid()) . '.jpg',
];
}
}