- menyesuaikan model jika ada yang salah seperti kurangnya trait SoftDeletes, casting yang salah, relasi yang kurang dan lainnya - memperbaiki enum di migrasi
29 lines
676 B
PHP
29 lines
676 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\PushNotification;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
class PushNotificationFactory extends Factory
|
|
{
|
|
protected $model = PushNotification::class;
|
|
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'user_id' => User::factory(),
|
|
'subscriptions' => [
|
|
[
|
|
'endpoint' => $this->faker->url(),
|
|
'keys' => [
|
|
'p256dh' => $this->faker->sha256(),
|
|
'auth' => $this->faker->md5(),
|
|
],
|
|
],
|
|
],
|
|
];
|
|
}
|
|
}
|