feat: adding ability to optimize and import older site content.

This commit is contained in:
2023-08-22 16:04:37 -05:00
parent 5c218918ee
commit 9a7aa89362
35 changed files with 1267 additions and 398 deletions

View File

@@ -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),
];
}
}

View File

@@ -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,
];
}
}

View File

@@ -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,
];
}
}

View File

@@ -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.
*

View File

@@ -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.
*

View File

@@ -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.
*