feat: adding ability to optimize and import older site content.
This commit is contained in:
@@ -29,7 +29,7 @@ class ArtistFactory extends Factory
|
||||
'header' => fake()->imageUrl(270, 185),
|
||||
'location' => fake()->city() . ', ' . fake()->state(),
|
||||
'website' => rand(0, 1) ? fake()->url : null,
|
||||
'bio' => fake()->paragraphs(rand(1,3, true)),
|
||||
'bio' => fake()->paragraphs(rand(1, 3), true),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,14 +27,18 @@ 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,
|
||||
'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,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,14 @@
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Artist;
|
||||
use App\Models\Artwork;
|
||||
use App\Models\Episode;
|
||||
use App\Models\Podcast;
|
||||
use App\Models\Artwork;
|
||||
use App\Models\Overlay;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class EpisodeFactory extends Factory
|
||||
{
|
||||
@@ -24,11 +27,20 @@ class EpisodeFactory extends Factory
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
$title = fake()->name();
|
||||
$slug = Str::slug($title);
|
||||
$created = fake()->dateTimeThisDecade();
|
||||
return [
|
||||
'podcast_id' => Podcast::factory(),
|
||||
'artwork_id' => Artwork::factory(),
|
||||
'published' => fake()->boolean(),
|
||||
'title' => fake()->name()
|
||||
'episode_date' => fake()->dateTimeThisDecade(),
|
||||
'slug' => $slug,
|
||||
'title' => $title,
|
||||
'mp3' => fake()->url(),
|
||||
'created_at' => $created,
|
||||
'updated_at' => $created,
|
||||
'legacy_id' => null,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,12 +4,23 @@ namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
use App\Models\Podcast;
|
||||
use App\Models\Artist;
|
||||
use App\Models\Artwork;
|
||||
use App\Models\Episode;
|
||||
use App\Models\Podcast;
|
||||
use App\Models\Overlay;
|
||||
|
||||
|
||||
class OverlayFactory extends Factory
|
||||
{
|
||||
|
||||
/**
|
||||
* The name of the factory's corresponding model
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Overlay::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
|
||||
@@ -4,10 +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.
|
||||
*
|
||||
|
||||
@@ -5,9 +5,22 @@ namespace Database\Factories;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use App\Models\Artist;
|
||||
use App\Models\Artwork;
|
||||
use App\Models\Episode;
|
||||
use App\Models\Podcast;
|
||||
use App\Models\Overlay;
|
||||
use App\Models\User;
|
||||
|
||||
|
||||
class UserFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = User::class;
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user