*/ class WatchFactory extends Factory { protected $model = \BookStack\Activity\Models\Watch::class; /** * Define the model's default state. * * @return array */ public function definition(): array { $book = Book::factory()->create(); return [ 'user_id' => User::factory(), 'watchable_id' => $book->id, 'watchable_type' => 'book', 'level' => WatchLevels::NEW, ]; } }