10-04-2026
This commit is contained in:
parent
4d6b4930b2
commit
4bb89aad8c
836 changed files with 52961 additions and 5950 deletions
66
database/factories/DisplayMediaFactory.php
Normal file
66
database/factories/DisplayMediaFactory.php
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\DisplayMedia;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<DisplayMedia>
|
||||
*/
|
||||
class DisplayMediaFactory extends Factory
|
||||
{
|
||||
protected $model = DisplayMedia::class;
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'filename' => fake()->word().'.webp',
|
||||
'disk' => 'public',
|
||||
'path' => 'display-media/test/'.fake()->uuid().'.webp',
|
||||
'external_url' => null,
|
||||
'source_type' => 'upload',
|
||||
'type' => 'image',
|
||||
'mime_type' => 'image/webp',
|
||||
'file_size' => fake()->numberBetween(10000, 5000000),
|
||||
'title' => fake()->sentence(3),
|
||||
'collection' => fake()->randomElement(['immobilien', 'moebel', 'brand', null]),
|
||||
'is_active' => true,
|
||||
];
|
||||
}
|
||||
|
||||
public function video(): static
|
||||
{
|
||||
return $this->state(fn () => [
|
||||
'filename' => fake()->word().'.mp4',
|
||||
'path' => 'display-media/test/'.fake()->uuid().'.mp4',
|
||||
'type' => 'video',
|
||||
'mime_type' => 'video/mp4',
|
||||
'file_size' => fake()->numberBetween(1000000, 50000000),
|
||||
]);
|
||||
}
|
||||
|
||||
public function external(): static
|
||||
{
|
||||
return $this->state(fn () => [
|
||||
'filename' => fake()->word().'.jpg',
|
||||
'disk' => 'public',
|
||||
'path' => null,
|
||||
'external_url' => 'https://drive.google.com/file/d/'.fake()->uuid().'/view',
|
||||
'source_type' => 'external',
|
||||
'file_size' => 0,
|
||||
'mime_type' => null,
|
||||
]);
|
||||
}
|
||||
|
||||
public function externalVideo(): static
|
||||
{
|
||||
return $this->external()->state(fn () => [
|
||||
'filename' => fake()->word().'.mp4',
|
||||
'type' => 'video',
|
||||
]);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue