You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

41 lines
1.2 KiB

<?php
namespace Database\Factories;
use App\Models\Collection;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\File>
*/
class FileFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition()
{
return [
"uuid" => 1,
"original_name" => fake()->name(),
"ext" => ['jpg', 'jpeg', 'png', 'webp'][rand(0, 3)],
"mimetype" => 'image',
"width" => rand(300, 2000),
"height" => rand(300, 2000),
"file_size" => rand(300, 2000),
"server_path" => date('y') . '/' . date('m'),
"sort" => rand(0, 23),
"alts" => [
'hello wroldswdfouiwref iuwrhgf ow rgfaw ghfawej',
'jhsf asduyfsadf sadf safsuf isfjsdfsudifsduiyf sdiuf sd'
],
"description" => 'ajsfoisahjfoaspf asduf safsafjsh lh',
"user_id" => rand(43724, 382348),
"ip" => "127.0. 0.1",
"collection_id" => Collection::factory()->create()->id,
"published_at" => "2022-07-27 09:17:59",
];
}
}