mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 15:07:49 +00:00
fix: Playlist, PlaylistItem Factories after migration change
This commit is contained in:
parent
11f4ccb946
commit
ec862942cd
2 changed files with 10 additions and 12 deletions
|
|
@ -4,7 +4,6 @@ namespace Database\Factories;
|
|||
|
||||
use App\Models\Device;
|
||||
use App\Models\Playlist;
|
||||
use App\Models\Plugin;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
|
|
@ -15,14 +14,14 @@ class PlaylistFactory extends Factory
|
|||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'order' => $this->faker->randomNumber(),
|
||||
'is_active' => $this->faker->boolean(),
|
||||
'last_displayed_at' => Carbon::now(),
|
||||
'name' => $this->faker->words(3, true),
|
||||
'is_active' => $this->faker->boolean(80), // 80% chance of being active
|
||||
'weekdays' => $this->faker->randomElements(range(0, 6), $this->faker->numberBetween(1, 7)),
|
||||
'active_from' => $this->faker->time('H:i:s'),
|
||||
'active_until' => $this->faker->time('H:i:s'),
|
||||
'created_at' => Carbon::now(),
|
||||
'updated_at' => Carbon::now(),
|
||||
|
||||
'device_id' => Device::factory(),
|
||||
'plugin_id' => Plugin::factory(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,14 +15,13 @@ class PlaylistItemFactory extends Factory
|
|||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'order' => $this->faker->randomNumber(),
|
||||
'is_active' => $this->faker->boolean(),
|
||||
'last_displayed_at' => Carbon::now(),
|
||||
'created_at' => Carbon::now(),
|
||||
'updated_at' => Carbon::now(),
|
||||
|
||||
'playlist_id' => Playlist::factory(),
|
||||
'plugin_id' => Plugin::factory(),
|
||||
'order' => $this->faker->numberBetween(0, 100),
|
||||
'is_active' => $this->faker->boolean(80), // 80% chance of being active
|
||||
'last_displayed_at' => null,
|
||||
'created_at' => Carbon::now(),
|
||||
'updated_at' => Carbon::now(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue