mirror of https://github.com/pixelfed/pixelfed
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
667 B
PHP
31 lines
667 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Activity;
|
|
use App\Profile;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
class ActivityFactory extends Factory
|
|
{
|
|
protected $model = Activity::class;
|
|
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'data' => json_encode(['type' => 'Create']),
|
|
'to_id' => Profile::factory(),
|
|
'from_id' => Profile::factory(),
|
|
'object_type' => 'status',
|
|
'processed_at' => null,
|
|
];
|
|
}
|
|
|
|
public function processed(): static
|
|
{
|
|
return $this->state(fn (array $attributes) => [
|
|
'processed_at' => now(),
|
|
]);
|
|
}
|
|
}
|