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:
@@ -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(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user