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:
@@ -4,9 +4,21 @@ 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 PodcastFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Podcast::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
@@ -14,12 +26,14 @@ class PodcastFactory extends Factory
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
$name = fake()->name();
|
||||
$slug = Str::slug($name);
|
||||
return [
|
||||
'name' => fake()->name(),
|
||||
'name' => $name,
|
||||
'description' => fake()->paragraphs(rand(1,3), true),
|
||||
'website' => 'https://' . fake()->domainName(),
|
||||
'feed' => fake()->url(),
|
||||
'slug' => fake()->slug(),
|
||||
'feed' => 'podcast/' . $slug,
|
||||
'slug' => $slug,
|
||||
'published' => fake()->boolean(),
|
||||
'added_at' => fake()->dateTimeThisDecade(),
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user