You've already forked Atomcms-edit
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:
@@ -229,10 +229,10 @@ The following optimizations are already configured:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Build
|
# Build
|
||||||
yarn build # Bouw alle thema's
|
yarn build # Build all themes
|
||||||
yarn build:atom # Bouw alleen atom theme
|
yarn build:atom # Build atom theme only
|
||||||
yarn build:dusk # Bouw alleen dusk theme
|
yarn build:dusk # Build dusk theme only
|
||||||
yarn build:all # Bouw beide thema's
|
yarn build:all # Build both themes
|
||||||
|
|
||||||
# Development
|
# Development
|
||||||
yarn dev # Start dev server
|
yarn dev # Start dev server
|
||||||
@@ -243,20 +243,20 @@ yarn lint # Check JS/Vue
|
|||||||
yarn lint:fix # Fix JS/Vue
|
yarn lint:fix # Fix JS/Vue
|
||||||
yarn lint:css # Check CSS
|
yarn lint:css # Check CSS
|
||||||
yarn lint:css:fix # Fix CSS
|
yarn lint:css:fix # Fix CSS
|
||||||
yarn lint:all # Check alles
|
yarn lint:all # Check everything
|
||||||
yarn lint:fix:all # Fix alles
|
yarn lint:fix:all # Fix everything
|
||||||
|
|
||||||
yarn format # Formatteer alles
|
yarn format # Format everything
|
||||||
yarn format:check # Check formatting
|
yarn format:check # Check formatting
|
||||||
|
|
||||||
# Check
|
# Check
|
||||||
yarn check # Volledige check
|
yarn check # Full check
|
||||||
yarn check:php # Check PHP syntax
|
yarn check:php # Check PHP syntax
|
||||||
yarn check:security # Check beveiliging
|
yarn check:security # Check security
|
||||||
yarn check:deps # Check verouderde packages
|
yarn check:deps # Check outdated packages
|
||||||
|
|
||||||
# Cache
|
# Cache
|
||||||
yarn clean # Verwijder cache
|
yarn clean # Clear cache
|
||||||
yarn rebuild # Clean + install + build
|
yarn rebuild # Clean + install + build
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -269,7 +269,7 @@ php artisan atom:fix-code
|
|||||||
# Fix gamedata symlinks (run after installing client assets)
|
# Fix gamedata symlinks (run after installing client assets)
|
||||||
php artisan atom:fix-gamedata-symlinks
|
php artisan atom:fix-gamedata-symlinks
|
||||||
|
|
||||||
# Static analysis (PHPStan Level 9)
|
# Static analysis (PHPStan Level 3)
|
||||||
./vendor/bin/phpstan analyse
|
./vendor/bin/phpstan analyse
|
||||||
|
|
||||||
# Build frontend assets
|
# 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 |
|
| **Vite 8** | Fastest build tool |
|
||||||
| **esbuild** | Snellere minificatie |
|
| **esbuild** | Faster minification |
|
||||||
| **Better chunking** | Optimalere code splitting |
|
| **Better chunking** | Optimal code splitting |
|
||||||
| **Gzip + Brotli** | Compressie (~70% kleiner) |
|
| **Gzip + Brotli** | Compression (~70% smaller) |
|
||||||
| **Resource hints** | DNS prefetch, preconnect, preload |
|
| **Resource hints** | DNS prefetch, preconnect, preload |
|
||||||
| **HTTP/2** | Snellere netwerk requests |
|
| **HTTP/2** | Faster network requests |
|
||||||
| **Console verwijderd** | Kleinere JS bestanden |
|
| **Console removed** | Smaller JS bundles |
|
||||||
| **Caching** | Vite cache + optimizedeps |
|
| **Caching** | Vite cache + optimizedeps |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -1368,7 +1368,7 @@ final class AlertSettings extends Page implements HasForms
|
|||||||
|
|
||||||
return new HtmlString($html);
|
return new HtmlString($html);
|
||||||
} catch (\Exception) {
|
} catch (\Exception) {
|
||||||
return new HtmlString('<span class="text-red-400">Kan niet laden</span>');
|
return new HtmlString('<span class="text-red-400">Could not load</span>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1396,9 +1396,9 @@ final class AlertSettings extends Page implements HasForms
|
|||||||
return new HtmlString('<div class="text-sm text-green-400">' . $uptime . '</div>');
|
return new HtmlString('<div class="text-sm text-green-400">' . $uptime . '</div>');
|
||||||
}
|
}
|
||||||
|
|
||||||
return new HtmlString('<span class="text-yellow-400">Niet actief</span>');
|
return new HtmlString('<span class="text-yellow-400">Not active</span>');
|
||||||
} catch (\Exception) {
|
} catch (\Exception) {
|
||||||
return new HtmlString('<span class="text-red-400">Kan niet laden</span>');
|
return new HtmlString('<span class="text-red-400">Could not load</span>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1413,16 +1413,16 @@ final class AlertSettings extends Page implements HasForms
|
|||||||
$html = '<div class="text-sm space-y-1">';
|
$html = '<div class="text-sm space-y-1">';
|
||||||
$html .= '<div><span class="text-gray-400">CPU Load:</span> <span class="text-green-400">' . $load[0] . '</span> (' . $cpuCount . ' cores)</div>';
|
$html .= '<div><span class="text-gray-400">CPU Load:</span> <span class="text-green-400">' . $load[0] . '</span> (' . $cpuCount . ' cores)</div>';
|
||||||
if ($memoryUsage) {
|
if ($memoryUsage) {
|
||||||
$html .= '<div><span class="text-gray-400">Geheugen:</span> <span class="text-blue-400">' . trim($memoryUsage) . '</span></div>';
|
$html .= '<div><span class="text-gray-400">Memory:</span> <span class="text-blue-400">' . trim($memoryUsage) . '</span></div>';
|
||||||
}
|
}
|
||||||
if ($diskUsage) {
|
if ($diskUsage) {
|
||||||
$html .= '<div><span class="text-gray-400">Schijf:</span> <span class="text-purple-400">' . trim($diskUsage) . '</span></div>';
|
$html .= '<div><span class="text-gray-400">Disk:</span> <span class="text-purple-400">' . trim($diskUsage) . '</span></div>';
|
||||||
}
|
}
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
return new HtmlString($html);
|
return new HtmlString($html);
|
||||||
} catch (\Exception) {
|
} catch (\Exception) {
|
||||||
return new HtmlString('<span class="text-red-400">Kan niet laden</span>');
|
return new HtmlString('<span class="text-red-400">Could not load</span>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace App\Models\Community\RareValue;
|
|||||||
|
|
||||||
use App\Models\Game\Furniture\CatalogItem;
|
use App\Models\Game\Furniture\CatalogItem;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
|
||||||
@@ -21,6 +22,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|||||||
*/
|
*/
|
||||||
class WebsiteRareValue extends Model
|
class WebsiteRareValue extends Model
|
||||||
{
|
{
|
||||||
|
use HasFactory;
|
||||||
#[\Override]
|
#[\Override]
|
||||||
protected $guarded = ['id', 'created_at', 'updated_at'];
|
protected $guarded = ['id', 'created_at', 'updated_at'];
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace App\Models\Community\RareValue;
|
|||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Illuminate\Database\Eloquent\Collection;
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
|
|
||||||
@@ -25,6 +26,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
|||||||
*/
|
*/
|
||||||
class WebsiteRareValueCategory extends Model
|
class WebsiteRareValueCategory extends Model
|
||||||
{
|
{
|
||||||
|
use HasFactory;
|
||||||
#[\Override]
|
#[\Override]
|
||||||
protected $guarded = ['id', 'created_at', 'updated_at'];
|
protected $guarded = ['id', 'created_at', 'updated_at'];
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ namespace App\Models\Community\Staff;
|
|||||||
use App\Models\Community\Teams\WebsiteTeam;
|
use App\Models\Community\Teams\WebsiteTeam;
|
||||||
use App\Models\Game\Permission;
|
use App\Models\Game\Permission;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
|
||||||
@@ -14,6 +15,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|||||||
*/
|
*/
|
||||||
class WebsiteStaffApplications extends Model
|
class WebsiteStaffApplications extends Model
|
||||||
{
|
{
|
||||||
|
use HasFactory;
|
||||||
#[\Override]
|
#[\Override]
|
||||||
protected $table = 'website_staff_applications';
|
protected $table = 'website_staff_applications';
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace App\Models\Community\Teams;
|
|||||||
|
|
||||||
use App\Models\Community\Staff\WebsiteOpenPosition;
|
use App\Models\Community\Staff\WebsiteOpenPosition;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
|
|
||||||
@@ -16,6 +17,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
|||||||
*/
|
*/
|
||||||
class WebsiteTeam extends Model
|
class WebsiteTeam extends Model
|
||||||
{
|
{
|
||||||
|
use HasFactory;
|
||||||
#[\Override]
|
#[\Override]
|
||||||
protected $table = 'website_teams';
|
protected $table = 'website_teams';
|
||||||
|
|
||||||
|
|||||||
@@ -3,11 +3,13 @@
|
|||||||
namespace App\Models\Game\Player;
|
namespace App\Models\Game\Player;
|
||||||
|
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
|
||||||
class UserBadge extends Model
|
class UserBadge extends Model
|
||||||
{
|
{
|
||||||
|
use HasFactory;
|
||||||
#[\Override]
|
#[\Override]
|
||||||
protected $table = 'users_badges';
|
protected $table = 'users_badges';
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Models\Game\Player;
|
namespace App\Models\Game\Player;
|
||||||
|
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
|
||||||
@@ -11,6 +12,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|||||||
*/
|
*/
|
||||||
class UserCurrency extends Model
|
class UserCurrency extends Model
|
||||||
{
|
{
|
||||||
|
use HasFactory;
|
||||||
#[\Override]
|
#[\Override]
|
||||||
protected $guarded = ['user_id', 'type'];
|
protected $guarded = ['user_id', 'type'];
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace App\Models\Help;
|
namespace App\Models\Help;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -12,6 +13,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
*/
|
*/
|
||||||
class WebsiteHelpCenterCategory extends Model
|
class WebsiteHelpCenterCategory extends Model
|
||||||
{
|
{
|
||||||
|
use HasFactory;
|
||||||
#[\Override]
|
#[\Override]
|
||||||
protected $guarded = ['id', 'created_at', 'updated_at', 'name', 'icon'];
|
protected $guarded = ['id', 'created_at', 'updated_at', 'name', 'icon'];
|
||||||
|
|
||||||
|
|||||||
@@ -4,10 +4,12 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace App\Models\Help;
|
namespace App\Models\Help;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
class WebsiteHelpCenterQuestion extends Model
|
class WebsiteHelpCenterQuestion extends Model
|
||||||
{
|
{
|
||||||
|
use HasFactory;
|
||||||
#[\Override]
|
#[\Override]
|
||||||
protected $table = 'help_questions';
|
protected $table = 'help_questions';
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ use App\Models\Concerns\BelongsToUser;
|
|||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Illuminate\Database\Eloquent\Collection;
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
@@ -35,6 +36,7 @@ use Stevebauman\Purify\Facades\Purify;
|
|||||||
class WebsiteHelpCenterTicket extends Model
|
class WebsiteHelpCenterTicket extends Model
|
||||||
{
|
{
|
||||||
use BelongsToUser;
|
use BelongsToUser;
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
#[\Override]
|
#[\Override]
|
||||||
protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'status', 'subject', 'category_id'];
|
protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'status', 'subject', 'category_id'];
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace App\Models\Help;
|
|||||||
|
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
@@ -22,6 +23,7 @@ use Stevebauman\Purify\Facades\Purify;
|
|||||||
*/
|
*/
|
||||||
class WebsiteHelpCenterTicketReply extends Model
|
class WebsiteHelpCenterTicketReply extends Model
|
||||||
{
|
{
|
||||||
|
use HasFactory;
|
||||||
#[\Override]
|
#[\Override]
|
||||||
protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'ticket_id', 'content'];
|
protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'ticket_id', 'content'];
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,13 @@
|
|||||||
|
|
||||||
namespace App\Models\Help;
|
namespace App\Models\Help;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
|
||||||
class WebsiteRule extends Model
|
class WebsiteRule extends Model
|
||||||
{
|
{
|
||||||
|
use HasFactory;
|
||||||
#[\Override]
|
#[\Override]
|
||||||
protected $guarded = ['id', 'category_id', 'created_at', 'updated_at'];
|
protected $guarded = ['id', 'category_id', 'created_at', 'updated_at'];
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,13 @@
|
|||||||
|
|
||||||
namespace App\Models\Help;
|
namespace App\Models\Help;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
|
|
||||||
class WebsiteRuleCategory extends Model
|
class WebsiteRuleCategory extends Model
|
||||||
{
|
{
|
||||||
|
use HasFactory;
|
||||||
#[\Override]
|
#[\Override]
|
||||||
protected $guarded = ['id', 'created_at', 'updated_at'];
|
protected $guarded = ['id', 'created_at', 'updated_at'];
|
||||||
|
|
||||||
|
|||||||
@@ -5,11 +5,13 @@ declare(strict_types=1);
|
|||||||
namespace App\Models\Shop;
|
namespace App\Models\Shop;
|
||||||
|
|
||||||
use App\Models\Concerns\BelongsToUser;
|
use App\Models\Concerns\BelongsToUser;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
class WebsitePaypalTransaction extends Model
|
class WebsitePaypalTransaction extends Model
|
||||||
{
|
{
|
||||||
use BelongsToUser;
|
use BelongsToUser;
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
#[\Override]
|
#[\Override]
|
||||||
protected $guarded = ['id', 'created_at', 'updated_at'];
|
protected $guarded = ['id', 'created_at', 'updated_at'];
|
||||||
|
|||||||
@@ -2,11 +2,13 @@
|
|||||||
|
|
||||||
namespace App\Models\Shop;
|
namespace App\Models\Shop;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
|
||||||
class WebsiteShopArticleFeature extends Model
|
class WebsiteShopArticleFeature extends Model
|
||||||
{
|
{
|
||||||
|
use HasFactory;
|
||||||
#[\Override]
|
#[\Override]
|
||||||
protected $guarded = ['id', 'created_at', 'updated_at', 'article_id', 'feature'];
|
protected $guarded = ['id', 'created_at', 'updated_at', 'article_id', 'feature'];
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace App\Models\Shop;
|
namespace App\Models\Shop;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -12,6 +13,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
*/
|
*/
|
||||||
class WebsiteShopVoucher extends Model
|
class WebsiteShopVoucher extends Model
|
||||||
{
|
{
|
||||||
|
use HasFactory;
|
||||||
#[\Override]
|
#[\Override]
|
||||||
protected $guarded = ['id', 'created_at', 'updated_at', 'code', 'amount', 'max_uses', 'expires_at'];
|
protected $guarded = ['id', 'created_at', 'updated_at', 'code', 'amount', 'max_uses', 'expires_at'];
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,13 @@
|
|||||||
|
|
||||||
namespace App\Models\Shop;
|
namespace App\Models\Shop;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
|
|
||||||
class WebsiteUsedShopVoucher extends Model
|
class WebsiteUsedShopVoucher extends Model
|
||||||
{
|
{
|
||||||
|
use HasFactory;
|
||||||
#[\Override]
|
#[\Override]
|
||||||
protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'voucher_id'];
|
protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'voucher_id'];
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace App\Models\User;
|
|||||||
|
|
||||||
use App\Models\Concerns\BelongsToUser;
|
use App\Models\Concerns\BelongsToUser;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
use Spatie\Activitylog\LogOptions;
|
use Spatie\Activitylog\LogOptions;
|
||||||
@@ -19,6 +20,7 @@ use Spatie\Activitylog\Traits\LogsActivity;
|
|||||||
class Ban extends Model
|
class Ban extends Model
|
||||||
{
|
{
|
||||||
use BelongsToUser;
|
use BelongsToUser;
|
||||||
|
use HasFactory;
|
||||||
use LogsActivity;
|
use LogsActivity;
|
||||||
|
|
||||||
#[\Override]
|
#[\Override]
|
||||||
|
|||||||
@@ -5,11 +5,13 @@ declare(strict_types=1);
|
|||||||
namespace App\Models\User;
|
namespace App\Models\User;
|
||||||
|
|
||||||
use App\Models\Concerns\BelongsToUser;
|
use App\Models\Concerns\BelongsToUser;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
class ClaimedReferralLog extends Model
|
class ClaimedReferralLog extends Model
|
||||||
{
|
{
|
||||||
use BelongsToUser;
|
use BelongsToUser;
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
#[\Override]
|
#[\Override]
|
||||||
protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'referral_id'];
|
protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'referral_id'];
|
||||||
|
|||||||
@@ -4,10 +4,12 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace App\Models\User;
|
namespace App\Models\User;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
class Referral extends Model
|
class Referral extends Model
|
||||||
{
|
{
|
||||||
|
use HasFactory;
|
||||||
#[\Override]
|
#[\Override]
|
||||||
protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'referrer_id'];
|
protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'referrer_id'];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
|||||||
namespace App\Models\User;
|
namespace App\Models\User;
|
||||||
|
|
||||||
use App\Models\Concerns\BelongsToUser;
|
use App\Models\Concerns\BelongsToUser;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -13,6 +14,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
class UserNotification extends Model
|
class UserNotification extends Model
|
||||||
{
|
{
|
||||||
use BelongsToUser;
|
use BelongsToUser;
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
#[\Override]
|
#[\Override]
|
||||||
protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'type'];
|
protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'type'];
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Models\User;
|
namespace App\Models\User;
|
||||||
|
|
||||||
use App\Models\Concerns\BelongsToUser;
|
use App\Models\Concerns\BelongsToUser;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -14,6 +15,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
class UserOrder extends Model
|
class UserOrder extends Model
|
||||||
{
|
{
|
||||||
use BelongsToUser;
|
use BelongsToUser;
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
#[\Override]
|
#[\Override]
|
||||||
protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'status', 'amount'];
|
protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'status', 'amount'];
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ namespace App\Models\User;
|
|||||||
use App\Models\Concerns\BelongsToUser;
|
use App\Models\Concerns\BelongsToUser;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -20,6 +21,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
class UserReferral extends Model
|
class UserReferral extends Model
|
||||||
{
|
{
|
||||||
use BelongsToUser;
|
use BelongsToUser;
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
#[\Override]
|
#[\Override]
|
||||||
protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'referral_code'];
|
protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'referral_code'];
|
||||||
|
|||||||
@@ -3,11 +3,13 @@
|
|||||||
namespace App\Models\User;
|
namespace App\Models\User;
|
||||||
|
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
|
||||||
class WebsiteUserGuestbook extends Model
|
class WebsiteUserGuestbook extends Model
|
||||||
{
|
{
|
||||||
|
use HasFactory;
|
||||||
#[\Override]
|
#[\Override]
|
||||||
protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'profile_id'];
|
protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'profile_id'];
|
||||||
|
|
||||||
|
|||||||
@@ -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(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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
@@ -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
@@ -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(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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
@@ -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
@@ -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
@@ -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'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
Executable
+38
@@ -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(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
Executable
+21
@@ -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
@@ -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
@@ -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
@@ -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(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user