feat/factory_creation (#1)
Prepping for launch. Reviewed-on: #1 Co-authored-by: Paul Couture <paul@paulcouture.com> Co-committed-by: Paul Couture <paul@paulcouture.com>
This commit was merged in pull request #1.
This commit is contained in:
@@ -3,9 +3,23 @@
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
use App\Models\Artist;
|
||||
use App\Models\Artwork;
|
||||
use App\Models\Episode;
|
||||
use App\Models\Podcast;
|
||||
use App\Models\Overlay;
|
||||
|
||||
class ArtworkFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* The name of the factory's corresponding model
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Artwork::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
@@ -13,8 +27,19 @@ class ArtworkFactory extends Factory
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
$created = fake()->dateTimeThisDecade();
|
||||
return [
|
||||
//
|
||||
'title' => fake()->name(),
|
||||
'description' => rand(0, 1) ? fake()->paragraphs(rand(1, 3), true) : null,
|
||||
'artist_id' => Artist::factory(),
|
||||
'podcast_id' => Podcast::factory(),
|
||||
'episode_id' => Episode::factory(),
|
||||
'overlay_id' => rand(0, 1) ? Overlay::factory() : null,
|
||||
'filename' => fake()->imageUrl(3000, 3000),
|
||||
'created_at' => $created,
|
||||
'updated_at' => $created,
|
||||
'legacy_id' => null,
|
||||
'approved_by' => null,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user