fix: standardize language to English in README and AlertSettings

feat: add 24 model factories for Help, Shop, Community, Game, User domains

- Translate mixed Dutch/English strings in README.md and AlertSettings.php
- Add HasFactory trait to 23 models
- Create factories for Help (6), Shop (4), Community (5), Game (2), User (7)
This commit is contained in:
root
2026-05-23 16:57:44 +02:00
parent 33c03e8b7b
commit 574b5d6e17
49 changed files with 647 additions and 27 deletions
@@ -0,0 +1,20 @@
<?php
namespace Database\Factories\Community\RareValue;
use App\Models\Community\RareValue\WebsiteRareValueCategory;
use Illuminate\Database\Eloquent\Factories\Factory;
class WebsiteRareValueCategoryFactory extends Factory
{
protected $model = WebsiteRareValueCategory::class;
public function definition(): array
{
return [
'name' => $this->faker->unique()->word(),
'badge' => $this->faker->word(),
'priority' => $this->faker->numberBetween(1, 10),
];
}
}
@@ -0,0 +1,24 @@
<?php
namespace Database\Factories\Community\RareValue;
use App\Models\Community\RareValue\WebsiteRareValue;
use Illuminate\Database\Eloquent\Factories\Factory;
class WebsiteRareValueFactory extends Factory
{
protected $model = WebsiteRareValue::class;
public function definition(): array
{
return [
'category_id' => WebsiteRareValueCategoryFactory::new(),
'item_id' => $this->faker->numberBetween(1, 10000),
'name' => $this->faker->unique()->word(),
'credit_value' => (string) $this->faker->numberBetween(1, 1000),
'currency_value' => (string) $this->faker->numberBetween(1, 100),
'currency_type' => 'diamonds',
'furniture_icon' => $this->faker->word() . '.png',
];
}
}
@@ -0,0 +1,23 @@
<?php
namespace Database\Factories\Community\Staff;
use App\Models\Community\Staff\WebsiteOpenPosition;
use App\Models\Community\Teams\WebsiteTeam;
use Illuminate\Database\Eloquent\Factories\Factory;
class WebsiteOpenPositionFactory extends Factory
{
protected $model = WebsiteOpenPosition::class;
public function definition(): array
{
return [
'team_id' => WebsiteTeam::factory(),
'position_kind' => $this->faker->randomElement(['rank', 'role']),
'permission_id' => 1,
'apply_from' => now()->subDay(),
'apply_to' => now()->addMonth(),
];
}
}
@@ -0,0 +1,39 @@
<?php
namespace Database\Factories\Community\Staff;
use App\Models\Community\Staff\WebsiteStaffApplications;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
class WebsiteStaffApplicationsFactory extends Factory
{
protected $model = WebsiteStaffApplications::class;
public function definition(): array
{
return [
'user_id' => User::factory(),
'rank_id' => 1,
'content' => $this->faker->paragraphs(3, true),
];
}
public function approved(): static
{
return $this->state(fn (array $attributes) => [
'status' => 'approved',
'approved_by' => User::factory(),
'approved_at' => now(),
]);
}
public function rejected(): static
{
return $this->state(fn (array $attributes) => [
'status' => 'rejected',
'rejected_by' => User::factory(),
'rejected_at' => now(),
]);
}
}
+23
View File
@@ -0,0 +1,23 @@
<?php
namespace Database\Factories\Community\Teams;
use App\Models\Community\Teams\WebsiteTeam;
use Illuminate\Database\Eloquent\Factories\Factory;
class WebsiteTeamFactory extends Factory
{
protected $model = WebsiteTeam::class;
public function definition(): array
{
return [
'rank_name' => $this->faker->unique()->jobTitle(),
'hidden_rank' => false,
'badge' => $this->faker->word(),
'job_description' => $this->faker->sentence(),
'staff_color' => '#327fa8',
'staff_background' => 'staff-bg.png',
];
}
}
+21
View File
@@ -0,0 +1,21 @@
<?php
namespace Database\Factories\Game\Player;
use App\Models\Game\Player\UserBadge;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
class UserBadgeFactory extends Factory
{
protected $model = UserBadge::class;
public function definition(): array
{
return [
'user_id' => User::factory(),
'badge_slot' => $this->faker->numberBetween(0, 5),
'badge_id' => $this->faker->bothify('???###'),
];
}
}
+21
View File
@@ -0,0 +1,21 @@
<?php
namespace Database\Factories\Game\Player;
use App\Models\Game\Player\UserCurrency;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
class UserCurrencyFactory extends Factory
{
protected $model = UserCurrency::class;
public function definition(): array
{
return [
'user_id' => User::factory(),
'type' => $this->faker->numberBetween(0, 5),
'amount' => $this->faker->numberBetween(100, 50000),
];
}
}
@@ -0,0 +1,26 @@
<?php
namespace Database\Factories\Help;
use App\Models\Help\WebsiteHelpCenterCategory;
use Illuminate\Database\Eloquent\Factories\Factory;
class WebsiteHelpCenterCategoryFactory extends Factory
{
protected $model = WebsiteHelpCenterCategory::class;
public function definition(): array
{
return [
'name' => $this->faker->unique()->word(),
'content' => $this->faker->paragraph(),
'position' => $this->faker->numberBetween(1, 10),
'image_url' => $this->faker->imageUrl(),
'button_text' => $this->faker->word(),
'button_url' => $this->faker->url(),
'button_color' => '#eeb425',
'button_border_color' => '#facc15',
'small_box' => false,
];
}
}
@@ -0,0 +1,20 @@
<?php
namespace Database\Factories\Help;
use App\Models\Help\WebsiteHelpCenterQuestion;
use Illuminate\Database\Eloquent\Factories\Factory;
class WebsiteHelpCenterQuestionFactory extends Factory
{
protected $model = WebsiteHelpCenterQuestion::class;
public function definition(): array
{
return [
'category_id' => WebsiteHelpCenterCategoryFactory::new(),
'question' => $this->faker->sentence() . '?',
'answer' => $this->faker->paragraph(),
];
}
}
+23
View File
@@ -0,0 +1,23 @@
<?php
namespace Database\Factories\Help;
use App\Models\Help\WebsiteHelpCenterTicket;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
class WebsiteHelpCenterTicketFactory extends Factory
{
protected $model = WebsiteHelpCenterTicket::class;
public function definition(): array
{
return [
'user_id' => User::factory(),
'category_id' => WebsiteHelpCenterCategoryFactory::new(),
'title' => $this->faker->sentence(),
'content' => $this->faker->paragraph(),
'open' => true,
];
}
}
@@ -0,0 +1,21 @@
<?php
namespace Database\Factories\Help;
use App\Models\Help\WebsiteHelpCenterTicketReply;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
class WebsiteHelpCenterTicketReplyFactory extends Factory
{
protected $model = WebsiteHelpCenterTicketReply::class;
public function definition(): array
{
return [
'ticket_id' => WebsiteHelpCenterTicketFactory::new(),
'user_id' => User::factory(),
'content' => $this->faker->paragraph(),
];
}
}
+20
View File
@@ -0,0 +1,20 @@
<?php
namespace Database\Factories\Help;
use App\Models\Help\WebsiteRuleCategory;
use Illuminate\Database\Eloquent\Factories\Factory;
class WebsiteRuleCategoryFactory extends Factory
{
protected $model = WebsiteRuleCategory::class;
public function definition(): array
{
return [
'name' => $this->faker->unique()->word(),
'description' => $this->faker->sentence(),
'badge' => $this->faker->word(),
];
}
}
+20
View File
@@ -0,0 +1,20 @@
<?php
namespace Database\Factories\Help;
use App\Models\Help\WebsiteRule;
use Illuminate\Database\Eloquent\Factories\Factory;
class WebsiteRuleFactory extends Factory
{
protected $model = WebsiteRule::class;
public function definition(): array
{
return [
'category_id' => WebsiteRuleCategoryFactory::new(),
'paragraph' => (string) $this->faker->numberBetween(1, 20),
'rule' => $this->faker->sentence(),
];
}
}
@@ -0,0 +1,24 @@
<?php
namespace Database\Factories\Shop;
use App\Models\Shop\WebsitePaypalTransaction;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
class WebsitePaypalTransactionFactory extends Factory
{
protected $model = WebsitePaypalTransaction::class;
public function definition(): array
{
return [
'user_id' => User::factory(),
'transaction_id' => $this->faker->uuid(),
'status' => $this->faker->randomElement(['completed', 'pending', 'failed']),
'description' => $this->faker->sentence(),
'amount' => $this->faker->randomFloat(2, 1, 100),
'currency' => 'USD',
];
}
}
@@ -0,0 +1,22 @@
<?php
namespace Database\Factories\Shop;
use App\Models\Shop\WebsiteShopArticle;
use App\Models\Shop\WebsiteShopArticleFeature;
use Illuminate\Database\Eloquent\Factories\Factory;
class WebsiteShopArticleFeatureFactory extends Factory
{
protected $model = WebsiteShopArticleFeature::class;
public function definition(): array
{
return [
'article_id' => WebsiteShopArticle::factory(),
'features' => json_encode([
$this->faker->word() => $this->faker->word(),
]),
];
}
}
+22
View File
@@ -0,0 +1,22 @@
<?php
namespace Database\Factories\Shop;
use App\Models\Shop\WebsiteShopVoucher;
use Illuminate\Database\Eloquent\Factories\Factory;
class WebsiteShopVoucherFactory extends Factory
{
protected $model = WebsiteShopVoucher::class;
public function definition(): array
{
return [
'code' => strtoupper($this->faker->bothify('VOUCHER-????-####')),
'max_uses' => $this->faker->numberBetween(1, 100),
'use_count' => 0,
'amount' => $this->faker->numberBetween(100, 5000),
'expires_at' => $this->faker->dateTimeBetween('+1 month', '+1 year'),
];
}
}
+20
View File
@@ -0,0 +1,20 @@
<?php
namespace Database\Factories\Shop;
use App\Models\Shop\WebsiteUsedShopVoucher;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
class WebsiteUsedShopVoucherFactory extends Factory
{
protected $model = WebsiteUsedShopVoucher::class;
public function definition(): array
{
return [
'user_id' => User::factory(),
'voucher_id' => WebsiteShopVoucherFactory::new(),
];
}
}
+38
View File
@@ -0,0 +1,38 @@
<?php
namespace Database\Factories\User;
use App\Models\User;
use App\Models\User\Ban;
use Illuminate\Database\Eloquent\Factories\Factory;
class BanFactory extends Factory
{
protected $model = Ban::class;
public function definition(): array
{
return [
'user_id' => User::factory(),
'user_staff_id' => User::factory(),
'ban_expire' => now()->addDays($this->faker->numberBetween(1, 365))->timestamp,
'type' => $this->faker->randomElement(['account', 'ip', 'machine']),
'reason' => $this->faker->sentence(),
'ip' => $this->faker->ipv4(),
];
}
public function expired(): static
{
return $this->state(fn (array $attributes) => [
'ban_expire' => now()->subDay()->timestamp,
]);
}
public function permanent(): static
{
return $this->state(fn (array $attributes) => [
'ban_expire' => 0,
]);
}
}
@@ -0,0 +1,21 @@
<?php
namespace Database\Factories\User;
use App\Models\User;
use App\Models\User\ClaimedReferralLog;
use Illuminate\Database\Eloquent\Factories\Factory;
class ClaimedReferralLogFactory extends Factory
{
protected $model = ClaimedReferralLog::class;
public function definition(): array
{
return [
'user_id' => User::factory(),
'referral_id' => $this->faker->numberBetween(1, 1000),
'ip_address' => $this->faker->ipv4(),
];
}
}
+21
View File
@@ -0,0 +1,21 @@
<?php
namespace Database\Factories\User;
use App\Models\User;
use App\Models\User\Referral;
use Illuminate\Database\Eloquent\Factories\Factory;
class ReferralFactory extends Factory
{
protected $model = Referral::class;
public function definition(): array
{
return [
'user_id' => User::factory(),
'referred_user_id' => User::factory(),
'referred_user_ip' => $this->faker->ipv4(),
];
}
}
+29
View File
@@ -0,0 +1,29 @@
<?php
namespace Database\Factories\User;
use App\Models\User;
use App\Models\User\UserNotification;
use Illuminate\Database\Eloquent\Factories\Factory;
class UserNotificationFactory extends Factory
{
protected $model = UserNotification::class;
public function definition(): array
{
return [
'user_id' => User::factory(),
'type' => $this->faker->word(),
'message' => $this->faker->sentence(),
'read' => false,
];
}
public function read(): static
{
return $this->state(fn (array $attributes) => [
'read' => true,
]);
}
}
@@ -0,0 +1,35 @@
<?php
namespace Database\Factories\User;
use App\Models\User;
use App\Models\User\UserOrder;
use Illuminate\Database\Eloquent\Factories\Factory;
class UserOrderFactory extends Factory
{
protected $model = UserOrder::class;
public function definition(): array
{
return [
'user_id' => User::factory(),
'status' => UserOrder::STATUS_PENDING,
'amount' => $this->faker->numberBetween(100, 50000),
];
}
public function completed(): static
{
return $this->state(fn (array $attributes) => [
'status' => UserOrder::STATUS_COMPLETED,
]);
}
public function cancelled(): static
{
return $this->state(fn (array $attributes) => [
'status' => UserOrder::STATUS_CANCELLED,
]);
}
}
+20
View File
@@ -0,0 +1,20 @@
<?php
namespace Database\Factories\User;
use App\Models\User;
use App\Models\User\UserReferral;
use Illuminate\Database\Eloquent\Factories\Factory;
class UserReferralFactory extends Factory
{
protected $model = UserReferral::class;
public function definition(): array
{
return [
'user_id' => User::factory(),
'referrals_total' => $this->faker->numberBetween(0, 50),
];
}
}
+21
View File
@@ -0,0 +1,21 @@
<?php
namespace Database\Factories\User;
use App\Models\User;
use App\Models\User\WebsiteUserGuestbook;
use Illuminate\Database\Eloquent\Factories\Factory;
class WebsiteUserGuestbookFactory extends Factory
{
protected $model = WebsiteUserGuestbook::class;
public function definition(): array
{
return [
'profile_id' => User::factory(),
'user_id' => User::factory(),
'message' => $this->faker->sentence(),
];
}
}