You've already forked Atomcms-edit
574b5d6e17
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)
30 lines
644 B
PHP
Executable File
30 lines
644 B
PHP
Executable File
<?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,
|
|
]);
|
|
}
|
|
}
|