From 574b5d6e17175c8c1026d3fa591e44a00b6f5b6c Mon Sep 17 00:00:00 2001 From: root Date: Sat, 23 May 2026 16:57:44 +0200 Subject: [PATCH] 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) --- README.md | 42 +++++++++---------- .../Pages/Monitoring/AlertSettings.php | 12 +++--- .../Community/RareValue/WebsiteRareValue.php | 2 + .../RareValue/WebsiteRareValueCategory.php | 2 + .../Staff/WebsiteStaffApplications.php | 2 + app/Models/Community/Teams/WebsiteTeam.php | 2 + app/Models/Game/Player/UserBadge.php | 2 + app/Models/Game/Player/UserCurrency.php | 2 + app/Models/Help/WebsiteHelpCenterCategory.php | 2 + app/Models/Help/WebsiteHelpCenterQuestion.php | 2 + app/Models/Help/WebsiteHelpCenterTicket.php | 2 + .../Help/WebsiteHelpCenterTicketReply.php | 2 + app/Models/Help/WebsiteRule.php | 2 + app/Models/Help/WebsiteRuleCategory.php | 2 + app/Models/Shop/WebsitePaypalTransaction.php | 2 + app/Models/Shop/WebsiteShopArticleFeature.php | 2 + app/Models/Shop/WebsiteShopVoucher.php | 2 + app/Models/Shop/WebsiteUsedShopVoucher.php | 2 + app/Models/User/Ban.php | 2 + app/Models/User/ClaimedReferralLog.php | 2 + app/Models/User/Referral.php | 2 + app/Models/User/UserNotification.php | 2 + app/Models/User/UserOrder.php | 2 + app/Models/User/UserReferral.php | 2 + app/Models/User/WebsiteUserGuestbook.php | 2 + .../WebsiteRareValueCategoryFactory.php | 20 +++++++++ .../RareValue/WebsiteRareValueFactory.php | 24 +++++++++++ .../Staff/WebsiteOpenPositionFactory.php | 23 ++++++++++ .../Staff/WebsiteStaffApplicationsFactory.php | 39 +++++++++++++++++ .../Community/Teams/WebsiteTeamFactory.php | 23 ++++++++++ .../Game/Player/UserBadgeFactory.php | 21 ++++++++++ .../Game/Player/UserCurrencyFactory.php | 21 ++++++++++ .../Help/WebsiteHelpCenterCategoryFactory.php | 26 ++++++++++++ .../Help/WebsiteHelpCenterQuestionFactory.php | 20 +++++++++ .../Help/WebsiteHelpCenterTicketFactory.php | 23 ++++++++++ .../WebsiteHelpCenterTicketReplyFactory.php | 21 ++++++++++ .../Help/WebsiteRuleCategoryFactory.php | 20 +++++++++ .../factories/Help/WebsiteRuleFactory.php | 20 +++++++++ .../Shop/WebsitePaypalTransactionFactory.php | 24 +++++++++++ .../Shop/WebsiteShopArticleFeatureFactory.php | 22 ++++++++++ .../Shop/WebsiteShopVoucherFactory.php | 22 ++++++++++ .../Shop/WebsiteUsedShopVoucherFactory.php | 20 +++++++++ database/factories/User/BanFactory.php | 38 +++++++++++++++++ .../User/ClaimedReferralLogFactory.php | 21 ++++++++++ database/factories/User/ReferralFactory.php | 21 ++++++++++ .../User/UserNotificationFactory.php | 29 +++++++++++++ database/factories/User/UserOrderFactory.php | 35 ++++++++++++++++ .../factories/User/UserReferralFactory.php | 20 +++++++++ .../User/WebsiteUserGuestbookFactory.php | 21 ++++++++++ 49 files changed, 647 insertions(+), 27 deletions(-) create mode 100755 database/factories/Community/RareValue/WebsiteRareValueCategoryFactory.php create mode 100755 database/factories/Community/RareValue/WebsiteRareValueFactory.php create mode 100755 database/factories/Community/Staff/WebsiteOpenPositionFactory.php create mode 100755 database/factories/Community/Staff/WebsiteStaffApplicationsFactory.php create mode 100755 database/factories/Community/Teams/WebsiteTeamFactory.php create mode 100755 database/factories/Game/Player/UserBadgeFactory.php create mode 100755 database/factories/Game/Player/UserCurrencyFactory.php create mode 100755 database/factories/Help/WebsiteHelpCenterCategoryFactory.php create mode 100755 database/factories/Help/WebsiteHelpCenterQuestionFactory.php create mode 100755 database/factories/Help/WebsiteHelpCenterTicketFactory.php create mode 100755 database/factories/Help/WebsiteHelpCenterTicketReplyFactory.php create mode 100755 database/factories/Help/WebsiteRuleCategoryFactory.php create mode 100755 database/factories/Help/WebsiteRuleFactory.php create mode 100644 database/factories/Shop/WebsitePaypalTransactionFactory.php create mode 100755 database/factories/Shop/WebsiteShopArticleFeatureFactory.php create mode 100755 database/factories/Shop/WebsiteShopVoucherFactory.php create mode 100755 database/factories/Shop/WebsiteUsedShopVoucherFactory.php create mode 100755 database/factories/User/BanFactory.php create mode 100644 database/factories/User/ClaimedReferralLogFactory.php create mode 100755 database/factories/User/ReferralFactory.php create mode 100755 database/factories/User/UserNotificationFactory.php create mode 100644 database/factories/User/UserOrderFactory.php create mode 100755 database/factories/User/UserReferralFactory.php create mode 100755 database/factories/User/WebsiteUserGuestbookFactory.php diff --git a/README.md b/README.md index c6e4c7d..2312af1 100755 --- a/README.md +++ b/README.md @@ -229,10 +229,10 @@ The following optimizations are already configured: ```bash # Build -yarn build # Bouw alle thema's -yarn build:atom # Bouw alleen atom theme -yarn build:dusk # Bouw alleen dusk theme -yarn build:all # Bouw beide thema's +yarn build # Build all themes +yarn build:atom # Build atom theme only +yarn build:dusk # Build dusk theme only +yarn build:all # Build both themes # Development yarn dev # Start dev server @@ -243,20 +243,20 @@ yarn lint # Check JS/Vue yarn lint:fix # Fix JS/Vue yarn lint:css # Check CSS yarn lint:css:fix # Fix CSS -yarn lint:all # Check alles -yarn lint:fix:all # Fix alles +yarn lint:all # Check everything +yarn lint:fix:all # Fix everything -yarn format # Formatteer alles +yarn format # Format everything yarn format:check # Check formatting # Check -yarn check # Volledige check +yarn check # Full check yarn check:php # Check PHP syntax -yarn check:security # Check beveiliging -yarn check:deps # Check verouderde packages +yarn check:security # Check security +yarn check:deps # Check outdated packages # Cache -yarn clean # Verwijder cache +yarn clean # Clear cache yarn rebuild # Clean + install + build ``` @@ -269,7 +269,7 @@ php artisan atom:fix-code # Fix gamedata symlinks (run after installing client assets) php artisan atom:fix-gamedata-symlinks -# Static analysis (PHPStan Level 9) +# Static analysis (PHPStan Level 3) ./vendor/bin/phpstan analyse # Build frontend assets @@ -286,19 +286,19 @@ yarn format --- -## ⚡ Performance Optimalisaties +## ⚡ Performance Optimizations -Deze CMS is volledig geoptimaliseerd: +This CMS is fully optimized: -| Optimalisatie | Beschrijving | +| Optimization | Description | | ---------------------- | --------------------------------- | -| **Vite 8** | Snelste build tool | -| **esbuild** | Snellere minificatie | -| **Better chunking** | Optimalere code splitting | -| **Gzip + Brotli** | Compressie (~70% kleiner) | +| **Vite 8** | Fastest build tool | +| **esbuild** | Faster minification | +| **Better chunking** | Optimal code splitting | +| **Gzip + Brotli** | Compression (~70% smaller) | | **Resource hints** | DNS prefetch, preconnect, preload | -| **HTTP/2** | Snellere netwerk requests | -| **Console verwijderd** | Kleinere JS bestanden | +| **HTTP/2** | Faster network requests | +| **Console removed** | Smaller JS bundles | | **Caching** | Vite cache + optimizedeps | --- diff --git a/app/Filament/Pages/Monitoring/AlertSettings.php b/app/Filament/Pages/Monitoring/AlertSettings.php index 3b4baad..eef3816 100755 --- a/app/Filament/Pages/Monitoring/AlertSettings.php +++ b/app/Filament/Pages/Monitoring/AlertSettings.php @@ -1368,7 +1368,7 @@ final class AlertSettings extends Page implements HasForms return new HtmlString($html); } catch (\Exception) { - return new HtmlString('Kan niet laden'); + return new HtmlString('Could not load'); } } @@ -1396,9 +1396,9 @@ final class AlertSettings extends Page implements HasForms return new HtmlString('
' . $uptime . '
'); } - return new HtmlString('Niet actief'); + return new HtmlString('Not active'); } catch (\Exception) { - return new HtmlString('Kan niet laden'); + return new HtmlString('Could not load'); } } @@ -1413,16 +1413,16 @@ final class AlertSettings extends Page implements HasForms $html = '
'; $html .= '
CPU Load: ' . $load[0] . ' (' . $cpuCount . ' cores)
'; if ($memoryUsage) { - $html .= '
Geheugen: ' . trim($memoryUsage) . '
'; + $html .= '
Memory: ' . trim($memoryUsage) . '
'; } if ($diskUsage) { - $html .= '
Schijf: ' . trim($diskUsage) . '
'; + $html .= '
Disk: ' . trim($diskUsage) . '
'; } $html .= '
'; return new HtmlString($html); } catch (\Exception) { - return new HtmlString('Kan niet laden'); + return new HtmlString('Could not load'); } } diff --git a/app/Models/Community/RareValue/WebsiteRareValue.php b/app/Models/Community/RareValue/WebsiteRareValue.php index a5dfbd9..657c1a7 100755 --- a/app/Models/Community/RareValue/WebsiteRareValue.php +++ b/app/Models/Community/RareValue/WebsiteRareValue.php @@ -4,6 +4,7 @@ namespace App\Models\Community\RareValue; use App\Models\Game\Furniture\CatalogItem; use Carbon\Carbon; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; @@ -21,6 +22,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; */ class WebsiteRareValue extends Model { + use HasFactory; #[\Override] protected $guarded = ['id', 'created_at', 'updated_at']; diff --git a/app/Models/Community/RareValue/WebsiteRareValueCategory.php b/app/Models/Community/RareValue/WebsiteRareValueCategory.php index bed8b1c..6715412 100755 --- a/app/Models/Community/RareValue/WebsiteRareValueCategory.php +++ b/app/Models/Community/RareValue/WebsiteRareValueCategory.php @@ -4,6 +4,7 @@ namespace App\Models\Community\RareValue; use Carbon\Carbon; use Illuminate\Database\Eloquent\Collection; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\HasMany; @@ -25,6 +26,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany; */ class WebsiteRareValueCategory extends Model { + use HasFactory; #[\Override] protected $guarded = ['id', 'created_at', 'updated_at']; diff --git a/app/Models/Community/Staff/WebsiteStaffApplications.php b/app/Models/Community/Staff/WebsiteStaffApplications.php index 6190d53..af0c23b 100755 --- a/app/Models/Community/Staff/WebsiteStaffApplications.php +++ b/app/Models/Community/Staff/WebsiteStaffApplications.php @@ -5,6 +5,7 @@ namespace App\Models\Community\Staff; use App\Models\Community\Teams\WebsiteTeam; use App\Models\Game\Permission; use App\Models\User; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; @@ -14,6 +15,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; */ class WebsiteStaffApplications extends Model { + use HasFactory; #[\Override] protected $table = 'website_staff_applications'; diff --git a/app/Models/Community/Teams/WebsiteTeam.php b/app/Models/Community/Teams/WebsiteTeam.php index 5039957..bd1ffe2 100755 --- a/app/Models/Community/Teams/WebsiteTeam.php +++ b/app/Models/Community/Teams/WebsiteTeam.php @@ -4,6 +4,7 @@ namespace App\Models\Community\Teams; use App\Models\Community\Staff\WebsiteOpenPosition; use App\Models\User; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\HasMany; @@ -16,6 +17,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany; */ class WebsiteTeam extends Model { + use HasFactory; #[\Override] protected $table = 'website_teams'; diff --git a/app/Models/Game/Player/UserBadge.php b/app/Models/Game/Player/UserBadge.php index d465de4..4e81a13 100755 --- a/app/Models/Game/Player/UserBadge.php +++ b/app/Models/Game/Player/UserBadge.php @@ -3,11 +3,13 @@ namespace App\Models\Game\Player; use App\Models\User; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; class UserBadge extends Model { + use HasFactory; #[\Override] protected $table = 'users_badges'; diff --git a/app/Models/Game/Player/UserCurrency.php b/app/Models/Game/Player/UserCurrency.php index 3bed52a..336858a 100755 --- a/app/Models/Game/Player/UserCurrency.php +++ b/app/Models/Game/Player/UserCurrency.php @@ -3,6 +3,7 @@ namespace App\Models\Game\Player; use App\Models\User; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; @@ -11,6 +12,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; */ class UserCurrency extends Model { + use HasFactory; #[\Override] protected $guarded = ['user_id', 'type']; diff --git a/app/Models/Help/WebsiteHelpCenterCategory.php b/app/Models/Help/WebsiteHelpCenterCategory.php index 75fb87c..24bb835 100755 --- a/app/Models/Help/WebsiteHelpCenterCategory.php +++ b/app/Models/Help/WebsiteHelpCenterCategory.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace App\Models\Help; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; /** @@ -12,6 +13,7 @@ use Illuminate\Database\Eloquent\Model; */ class WebsiteHelpCenterCategory extends Model { + use HasFactory; #[\Override] protected $guarded = ['id', 'created_at', 'updated_at', 'name', 'icon']; diff --git a/app/Models/Help/WebsiteHelpCenterQuestion.php b/app/Models/Help/WebsiteHelpCenterQuestion.php index c2f625c..4246e3d 100755 --- a/app/Models/Help/WebsiteHelpCenterQuestion.php +++ b/app/Models/Help/WebsiteHelpCenterQuestion.php @@ -4,10 +4,12 @@ declare(strict_types=1); namespace App\Models\Help; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class WebsiteHelpCenterQuestion extends Model { + use HasFactory; #[\Override] protected $table = 'help_questions'; diff --git a/app/Models/Help/WebsiteHelpCenterTicket.php b/app/Models/Help/WebsiteHelpCenterTicket.php index ba43fe8..72bda68 100755 --- a/app/Models/Help/WebsiteHelpCenterTicket.php +++ b/app/Models/Help/WebsiteHelpCenterTicket.php @@ -6,6 +6,7 @@ use App\Models\Concerns\BelongsToUser; use App\Models\User; use Carbon\Carbon; use Illuminate\Database\Eloquent\Collection; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\HasMany; @@ -35,6 +36,7 @@ use Stevebauman\Purify\Facades\Purify; class WebsiteHelpCenterTicket extends Model { use BelongsToUser; + use HasFactory; #[\Override] protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'status', 'subject', 'category_id']; diff --git a/app/Models/Help/WebsiteHelpCenterTicketReply.php b/app/Models/Help/WebsiteHelpCenterTicketReply.php index 0c02fd7..7537da9 100755 --- a/app/Models/Help/WebsiteHelpCenterTicketReply.php +++ b/app/Models/Help/WebsiteHelpCenterTicketReply.php @@ -4,6 +4,7 @@ namespace App\Models\Help; use App\Models\User; use Carbon\Carbon; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Support\Facades\Auth; @@ -22,6 +23,7 @@ use Stevebauman\Purify\Facades\Purify; */ class WebsiteHelpCenterTicketReply extends Model { + use HasFactory; #[\Override] protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'ticket_id', 'content']; diff --git a/app/Models/Help/WebsiteRule.php b/app/Models/Help/WebsiteRule.php index 395094e..755c370 100755 --- a/app/Models/Help/WebsiteRule.php +++ b/app/Models/Help/WebsiteRule.php @@ -2,11 +2,13 @@ namespace App\Models\Help; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; class WebsiteRule extends Model { + use HasFactory; #[\Override] protected $guarded = ['id', 'category_id', 'created_at', 'updated_at']; diff --git a/app/Models/Help/WebsiteRuleCategory.php b/app/Models/Help/WebsiteRuleCategory.php index e00e44b..0e3dc10 100755 --- a/app/Models/Help/WebsiteRuleCategory.php +++ b/app/Models/Help/WebsiteRuleCategory.php @@ -2,11 +2,13 @@ namespace App\Models\Help; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\HasMany; class WebsiteRuleCategory extends Model { + use HasFactory; #[\Override] protected $guarded = ['id', 'created_at', 'updated_at']; diff --git a/app/Models/Shop/WebsitePaypalTransaction.php b/app/Models/Shop/WebsitePaypalTransaction.php index 7cd9ed7..653afbb 100755 --- a/app/Models/Shop/WebsitePaypalTransaction.php +++ b/app/Models/Shop/WebsitePaypalTransaction.php @@ -5,11 +5,13 @@ declare(strict_types=1); namespace App\Models\Shop; use App\Models\Concerns\BelongsToUser; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class WebsitePaypalTransaction extends Model { use BelongsToUser; + use HasFactory; #[\Override] protected $guarded = ['id', 'created_at', 'updated_at']; diff --git a/app/Models/Shop/WebsiteShopArticleFeature.php b/app/Models/Shop/WebsiteShopArticleFeature.php index bd23194..ba91c93 100755 --- a/app/Models/Shop/WebsiteShopArticleFeature.php +++ b/app/Models/Shop/WebsiteShopArticleFeature.php @@ -2,11 +2,13 @@ namespace App\Models\Shop; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; class WebsiteShopArticleFeature extends Model { + use HasFactory; #[\Override] protected $guarded = ['id', 'created_at', 'updated_at', 'article_id', 'feature']; diff --git a/app/Models/Shop/WebsiteShopVoucher.php b/app/Models/Shop/WebsiteShopVoucher.php index 5573950..d16adb4 100755 --- a/app/Models/Shop/WebsiteShopVoucher.php +++ b/app/Models/Shop/WebsiteShopVoucher.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace App\Models\Shop; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; /** @@ -12,6 +13,7 @@ use Illuminate\Database\Eloquent\Model; */ class WebsiteShopVoucher extends Model { + use HasFactory; #[\Override] protected $guarded = ['id', 'created_at', 'updated_at', 'code', 'amount', 'max_uses', 'expires_at']; diff --git a/app/Models/Shop/WebsiteUsedShopVoucher.php b/app/Models/Shop/WebsiteUsedShopVoucher.php index 097eb85..458d265 100755 --- a/app/Models/Shop/WebsiteUsedShopVoucher.php +++ b/app/Models/Shop/WebsiteUsedShopVoucher.php @@ -2,11 +2,13 @@ namespace App\Models\Shop; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\HasMany; class WebsiteUsedShopVoucher extends Model { + use HasFactory; #[\Override] protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'voucher_id']; diff --git a/app/Models/User/Ban.php b/app/Models/User/Ban.php index e31ef05..fe8f6be 100755 --- a/app/Models/User/Ban.php +++ b/app/Models/User/Ban.php @@ -4,6 +4,7 @@ namespace App\Models\User; use App\Models\Concerns\BelongsToUser; use App\Models\User; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Spatie\Activitylog\LogOptions; @@ -19,6 +20,7 @@ use Spatie\Activitylog\Traits\LogsActivity; class Ban extends Model { use BelongsToUser; + use HasFactory; use LogsActivity; #[\Override] diff --git a/app/Models/User/ClaimedReferralLog.php b/app/Models/User/ClaimedReferralLog.php index 40bcd57..d0e8ce0 100755 --- a/app/Models/User/ClaimedReferralLog.php +++ b/app/Models/User/ClaimedReferralLog.php @@ -5,11 +5,13 @@ declare(strict_types=1); namespace App\Models\User; use App\Models\Concerns\BelongsToUser; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class ClaimedReferralLog extends Model { use BelongsToUser; + use HasFactory; #[\Override] protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'referral_id']; diff --git a/app/Models/User/Referral.php b/app/Models/User/Referral.php index b6e3bf2..3236e10 100755 --- a/app/Models/User/Referral.php +++ b/app/Models/User/Referral.php @@ -4,10 +4,12 @@ declare(strict_types=1); namespace App\Models\User; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Referral extends Model { + use HasFactory; #[\Override] protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'referrer_id']; } diff --git a/app/Models/User/UserNotification.php b/app/Models/User/UserNotification.php index 0c4b8a2..58a7a0f 100755 --- a/app/Models/User/UserNotification.php +++ b/app/Models/User/UserNotification.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace App\Models\User; use App\Models\Concerns\BelongsToUser; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; /** @@ -13,6 +14,7 @@ use Illuminate\Database\Eloquent\Model; class UserNotification extends Model { use BelongsToUser; + use HasFactory; #[\Override] protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'type']; diff --git a/app/Models/User/UserOrder.php b/app/Models/User/UserOrder.php index 24ba3d2..222ca96 100755 --- a/app/Models/User/UserOrder.php +++ b/app/Models/User/UserOrder.php @@ -3,6 +3,7 @@ namespace App\Models\User; use App\Models\Concerns\BelongsToUser; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; /** @@ -14,6 +15,7 @@ use Illuminate\Database\Eloquent\Model; class UserOrder extends Model { use BelongsToUser; + use HasFactory; #[\Override] protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'status', 'amount']; diff --git a/app/Models/User/UserReferral.php b/app/Models/User/UserReferral.php index f049561..594c4eb 100755 --- a/app/Models/User/UserReferral.php +++ b/app/Models/User/UserReferral.php @@ -7,6 +7,7 @@ namespace App\Models\User; use App\Models\Concerns\BelongsToUser; use App\Models\User; use Carbon\Carbon; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; /** @@ -20,6 +21,7 @@ use Illuminate\Database\Eloquent\Model; class UserReferral extends Model { use BelongsToUser; + use HasFactory; #[\Override] protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'referral_code']; diff --git a/app/Models/User/WebsiteUserGuestbook.php b/app/Models/User/WebsiteUserGuestbook.php index 6a89132..e34bfa1 100755 --- a/app/Models/User/WebsiteUserGuestbook.php +++ b/app/Models/User/WebsiteUserGuestbook.php @@ -3,11 +3,13 @@ namespace App\Models\User; use App\Models\User; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; class WebsiteUserGuestbook extends Model { + use HasFactory; #[\Override] protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'profile_id']; diff --git a/database/factories/Community/RareValue/WebsiteRareValueCategoryFactory.php b/database/factories/Community/RareValue/WebsiteRareValueCategoryFactory.php new file mode 100755 index 0000000..56045a7 --- /dev/null +++ b/database/factories/Community/RareValue/WebsiteRareValueCategoryFactory.php @@ -0,0 +1,20 @@ + $this->faker->unique()->word(), + 'badge' => $this->faker->word(), + 'priority' => $this->faker->numberBetween(1, 10), + ]; + } +} diff --git a/database/factories/Community/RareValue/WebsiteRareValueFactory.php b/database/factories/Community/RareValue/WebsiteRareValueFactory.php new file mode 100755 index 0000000..6291548 --- /dev/null +++ b/database/factories/Community/RareValue/WebsiteRareValueFactory.php @@ -0,0 +1,24 @@ + 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', + ]; + } +} diff --git a/database/factories/Community/Staff/WebsiteOpenPositionFactory.php b/database/factories/Community/Staff/WebsiteOpenPositionFactory.php new file mode 100755 index 0000000..b6119cf --- /dev/null +++ b/database/factories/Community/Staff/WebsiteOpenPositionFactory.php @@ -0,0 +1,23 @@ + WebsiteTeam::factory(), + 'position_kind' => $this->faker->randomElement(['rank', 'role']), + 'permission_id' => 1, + 'apply_from' => now()->subDay(), + 'apply_to' => now()->addMonth(), + ]; + } +} diff --git a/database/factories/Community/Staff/WebsiteStaffApplicationsFactory.php b/database/factories/Community/Staff/WebsiteStaffApplicationsFactory.php new file mode 100755 index 0000000..c9f7940 --- /dev/null +++ b/database/factories/Community/Staff/WebsiteStaffApplicationsFactory.php @@ -0,0 +1,39 @@ + 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(), + ]); + } +} diff --git a/database/factories/Community/Teams/WebsiteTeamFactory.php b/database/factories/Community/Teams/WebsiteTeamFactory.php new file mode 100755 index 0000000..eb44839 --- /dev/null +++ b/database/factories/Community/Teams/WebsiteTeamFactory.php @@ -0,0 +1,23 @@ + $this->faker->unique()->jobTitle(), + 'hidden_rank' => false, + 'badge' => $this->faker->word(), + 'job_description' => $this->faker->sentence(), + 'staff_color' => '#327fa8', + 'staff_background' => 'staff-bg.png', + ]; + } +} diff --git a/database/factories/Game/Player/UserBadgeFactory.php b/database/factories/Game/Player/UserBadgeFactory.php new file mode 100755 index 0000000..c38697c --- /dev/null +++ b/database/factories/Game/Player/UserBadgeFactory.php @@ -0,0 +1,21 @@ + User::factory(), + 'badge_slot' => $this->faker->numberBetween(0, 5), + 'badge_id' => $this->faker->bothify('???###'), + ]; + } +} diff --git a/database/factories/Game/Player/UserCurrencyFactory.php b/database/factories/Game/Player/UserCurrencyFactory.php new file mode 100755 index 0000000..ac9259c --- /dev/null +++ b/database/factories/Game/Player/UserCurrencyFactory.php @@ -0,0 +1,21 @@ + User::factory(), + 'type' => $this->faker->numberBetween(0, 5), + 'amount' => $this->faker->numberBetween(100, 50000), + ]; + } +} diff --git a/database/factories/Help/WebsiteHelpCenterCategoryFactory.php b/database/factories/Help/WebsiteHelpCenterCategoryFactory.php new file mode 100755 index 0000000..b93e5e2 --- /dev/null +++ b/database/factories/Help/WebsiteHelpCenterCategoryFactory.php @@ -0,0 +1,26 @@ + $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, + ]; + } +} diff --git a/database/factories/Help/WebsiteHelpCenterQuestionFactory.php b/database/factories/Help/WebsiteHelpCenterQuestionFactory.php new file mode 100755 index 0000000..8234062 --- /dev/null +++ b/database/factories/Help/WebsiteHelpCenterQuestionFactory.php @@ -0,0 +1,20 @@ + WebsiteHelpCenterCategoryFactory::new(), + 'question' => $this->faker->sentence() . '?', + 'answer' => $this->faker->paragraph(), + ]; + } +} diff --git a/database/factories/Help/WebsiteHelpCenterTicketFactory.php b/database/factories/Help/WebsiteHelpCenterTicketFactory.php new file mode 100755 index 0000000..ecfafa9 --- /dev/null +++ b/database/factories/Help/WebsiteHelpCenterTicketFactory.php @@ -0,0 +1,23 @@ + User::factory(), + 'category_id' => WebsiteHelpCenterCategoryFactory::new(), + 'title' => $this->faker->sentence(), + 'content' => $this->faker->paragraph(), + 'open' => true, + ]; + } +} diff --git a/database/factories/Help/WebsiteHelpCenterTicketReplyFactory.php b/database/factories/Help/WebsiteHelpCenterTicketReplyFactory.php new file mode 100755 index 0000000..9bcf762 --- /dev/null +++ b/database/factories/Help/WebsiteHelpCenterTicketReplyFactory.php @@ -0,0 +1,21 @@ + WebsiteHelpCenterTicketFactory::new(), + 'user_id' => User::factory(), + 'content' => $this->faker->paragraph(), + ]; + } +} diff --git a/database/factories/Help/WebsiteRuleCategoryFactory.php b/database/factories/Help/WebsiteRuleCategoryFactory.php new file mode 100755 index 0000000..613a2da --- /dev/null +++ b/database/factories/Help/WebsiteRuleCategoryFactory.php @@ -0,0 +1,20 @@ + $this->faker->unique()->word(), + 'description' => $this->faker->sentence(), + 'badge' => $this->faker->word(), + ]; + } +} diff --git a/database/factories/Help/WebsiteRuleFactory.php b/database/factories/Help/WebsiteRuleFactory.php new file mode 100755 index 0000000..37e56f9 --- /dev/null +++ b/database/factories/Help/WebsiteRuleFactory.php @@ -0,0 +1,20 @@ + WebsiteRuleCategoryFactory::new(), + 'paragraph' => (string) $this->faker->numberBetween(1, 20), + 'rule' => $this->faker->sentence(), + ]; + } +} diff --git a/database/factories/Shop/WebsitePaypalTransactionFactory.php b/database/factories/Shop/WebsitePaypalTransactionFactory.php new file mode 100644 index 0000000..89c1386 --- /dev/null +++ b/database/factories/Shop/WebsitePaypalTransactionFactory.php @@ -0,0 +1,24 @@ + 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', + ]; + } +} diff --git a/database/factories/Shop/WebsiteShopArticleFeatureFactory.php b/database/factories/Shop/WebsiteShopArticleFeatureFactory.php new file mode 100755 index 0000000..16368ad --- /dev/null +++ b/database/factories/Shop/WebsiteShopArticleFeatureFactory.php @@ -0,0 +1,22 @@ + WebsiteShopArticle::factory(), + 'features' => json_encode([ + $this->faker->word() => $this->faker->word(), + ]), + ]; + } +} diff --git a/database/factories/Shop/WebsiteShopVoucherFactory.php b/database/factories/Shop/WebsiteShopVoucherFactory.php new file mode 100755 index 0000000..cee83d3 --- /dev/null +++ b/database/factories/Shop/WebsiteShopVoucherFactory.php @@ -0,0 +1,22 @@ + 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'), + ]; + } +} diff --git a/database/factories/Shop/WebsiteUsedShopVoucherFactory.php b/database/factories/Shop/WebsiteUsedShopVoucherFactory.php new file mode 100755 index 0000000..f0d8ab2 --- /dev/null +++ b/database/factories/Shop/WebsiteUsedShopVoucherFactory.php @@ -0,0 +1,20 @@ + User::factory(), + 'voucher_id' => WebsiteShopVoucherFactory::new(), + ]; + } +} diff --git a/database/factories/User/BanFactory.php b/database/factories/User/BanFactory.php new file mode 100755 index 0000000..abd9fa0 --- /dev/null +++ b/database/factories/User/BanFactory.php @@ -0,0 +1,38 @@ + 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, + ]); + } +} diff --git a/database/factories/User/ClaimedReferralLogFactory.php b/database/factories/User/ClaimedReferralLogFactory.php new file mode 100644 index 0000000..b4bb3f9 --- /dev/null +++ b/database/factories/User/ClaimedReferralLogFactory.php @@ -0,0 +1,21 @@ + User::factory(), + 'referral_id' => $this->faker->numberBetween(1, 1000), + 'ip_address' => $this->faker->ipv4(), + ]; + } +} diff --git a/database/factories/User/ReferralFactory.php b/database/factories/User/ReferralFactory.php new file mode 100755 index 0000000..3dfd678 --- /dev/null +++ b/database/factories/User/ReferralFactory.php @@ -0,0 +1,21 @@ + User::factory(), + 'referred_user_id' => User::factory(), + 'referred_user_ip' => $this->faker->ipv4(), + ]; + } +} diff --git a/database/factories/User/UserNotificationFactory.php b/database/factories/User/UserNotificationFactory.php new file mode 100755 index 0000000..f485bcf --- /dev/null +++ b/database/factories/User/UserNotificationFactory.php @@ -0,0 +1,29 @@ + User::factory(), + 'type' => $this->faker->word(), + 'message' => $this->faker->sentence(), + 'read' => false, + ]; + } + + public function read(): static + { + return $this->state(fn (array $attributes) => [ + 'read' => true, + ]); + } +} diff --git a/database/factories/User/UserOrderFactory.php b/database/factories/User/UserOrderFactory.php new file mode 100644 index 0000000..036f634 --- /dev/null +++ b/database/factories/User/UserOrderFactory.php @@ -0,0 +1,35 @@ + 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, + ]); + } +} diff --git a/database/factories/User/UserReferralFactory.php b/database/factories/User/UserReferralFactory.php new file mode 100755 index 0000000..44c9e1d --- /dev/null +++ b/database/factories/User/UserReferralFactory.php @@ -0,0 +1,20 @@ + User::factory(), + 'referrals_total' => $this->faker->numberBetween(0, 50), + ]; + } +} diff --git a/database/factories/User/WebsiteUserGuestbookFactory.php b/database/factories/User/WebsiteUserGuestbookFactory.php new file mode 100755 index 0000000..a7bd093 --- /dev/null +++ b/database/factories/User/WebsiteUserGuestbookFactory.php @@ -0,0 +1,21 @@ + User::factory(), + 'user_id' => User::factory(), + 'message' => $this->faker->sentence(), + ]; + } +}