podcastartgenerator/site/database/factories/ArtistFactory.php

42 lines
1.0 KiB
PHP
Raw Normal View History

<?php
namespace Database\Factories;
use App\Models\Artist;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\Str;
class ArtistFactory extends Factory
{
/**
* The name of the factory's corresponding model
*
* @var string
*/
protected $model = Artist::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
$name = fake()->name();
$slug = Str::slug(strtolower(trim($name)));
return [
'user_id' => User::factory(),
'name' => $name,
'slug' => $slug,
'avatar' => fake()->imageUrl(512, 512),
'header' => fake()->imageUrl(270, 185),
'location' => fake()->city() . ', ' . fake()->state(),
2023-12-21 11:20:49 -05:00
'alby' => null,
'naasocial' => null,
'website' => rand(0, 1) ? fake()->url : null,
'bio' => fake()->paragraphs(rand(1, 3), true),
];
}
}