Files
mtdb_movie/common/Comments/CommentFactory.php
maher 703f50a09d
Some checks failed
Build / run (push) Has been cancelled
first commit
2025-10-29 11:42:25 +01:00

30 lines
730 B
PHP
Executable File

<?php
namespace Common\Comments;
use App\Models\User;
use Arr;
use Common\Auth\Roles\Role;
use Common\Billing\Models\Product;
use Illuminate\Database\Eloquent\Factories\Factory;
class CommentFactory extends Factory
{
protected $model = Comment::class;
public function definition(): array
{
return [
'content' => $this->faker->realText(),
'commentable_type' => Arr::random([
User::MODEL_TYPE,
Product::MODEL_TYPE,
Role::MODEL_TYPE,
]),
'commentable_id' => Arr::random([1, 2, 3, 4, 5]),
'user_id' => Arr::random([1, 2, 3, 4, 5]),
'parent_id' => Arr::random([1, null]),
];
}
}