|
|
<?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)], "memetype" => '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", ]; } }
|