TDoG-Skin/database/factories/TextureFactory.php
2024-08-17 19:13:54 +08:00

42 lines
880 B
PHP
Executable File

<?php
namespace Database\Factories;
use App\Models\Texture;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
class TextureFactory extends Factory
{
protected $model = Texture::class;
public function definition()
{
return [
'name' => $this->faker->firstName,
'type' => 'steve',
'hash' => $this->faker->sha256,
'size' => rand(1, 2048),
'likes' => rand(1, 10),
'uploader' => User::factory(),
'public' => true,
'upload_at' => $this->faker->dateTime,
];
}
public function alex()
{
return $this->state(['type' => 'alex']);
}
public function cape()
{
return $this->state(['type' => 'cape']);
}
public function private()
{
return $this->state(['public' => false]);
}
}