feat(factories): add new factories and update existing ones for all models
This commit is contained in:
@@ -2,22 +2,34 @@
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Containers\AppStructure\Models\SubSection;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Page>
|
||||
*/
|
||||
class PageFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
protected $model = \App\Containers\AppStructure\Models\Page::class;
|
||||
|
||||
public function definition(): array
|
||||
{
|
||||
$title = $this->faker->words(3, true);
|
||||
$slug = Str::slug($title);
|
||||
|
||||
return [
|
||||
//
|
||||
'title' => $title,
|
||||
'slug' => $slug,
|
||||
'path' => $slug,
|
||||
'content' => [['type' => 'paragraph', 'data' => ['content' => $this->faker->paragraph]]],
|
||||
'is_registered' => false,
|
||||
'is_visible' => true,
|
||||
'searchable' => true,
|
||||
'is_url' => false,
|
||||
'code' => 200,
|
||||
'sub_section_id' => null,
|
||||
'search_data' => $this->faker->words(5, true),
|
||||
'settings' => null,
|
||||
'sort' => $this->faker->numberBetween(1, 100),
|
||||
'icon' => null,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user