Files
jandl-taskmanager-app/be/database/factories/AttachmentFactory.php
2023-01-24 21:54:03 +01:00

33 lines
895 B
PHP

<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Attachment>
*/
class AttachmentFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition()
{
$extension = fake()->randomElement(['jpg', 'png', 'jpeg', 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'csv']);
return [
'original_name' => fake()->words(2, true) . '.' . $extension,
'disk_name' => Str::random(15) . '.' . $extension,
'path' => fake()->imageUrl(),
'extension' => $extension,
'content_type' => fake()->mimeType(),
'file_size' => fake()->numberBetween(1323,992385),
];
}
}