Files
UNIT3D-Community-Edition/database/factories/UserSettingFactory.php
Roardom d00475778b update: normalize user settings
Use a 1-1 relation. Cache it indefinitely to reduce queries for every http request. This will make it much easier to add additional user settings for various site features without sacrificing clean code or performance.
2024-05-26 10:42:00 +00:00

42 lines
1.2 KiB
PHP

<?php
declare(strict_types=1);
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use App\Models\UserSetting;
/**
* @extends Factory<UserSetting>
*/
class UserSettingFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*/
protected $model = UserSetting::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'censor' => $this->faker->boolean(),
'chat_hidden' => $this->faker->boolean(),
'hidden' => $this->faker->boolean(),
'style' => $this->faker->boolean(),
'torrent_layout' => $this->faker->boolean(),
'torrent_filters' => $this->faker->boolean(),
'custom_css' => $this->faker->word(),
'standalone_css' => $this->faker->word(),
'show_poster' => $this->faker->boolean(),
'private_profile' => $this->faker->boolean(),
'block_notifications' => $this->faker->boolean(),
];
}
}