create(); Shift::factory()->inactive()->create(); $this->assertSame([$active->id], Shift::active()->pluck('id')->all()); } public function test_open_scope_returns_only_unassigned_shifts(): void { $open = Shift::factory()->create(); Shift::factory()->forDoctor()->create(); $this->assertSame([$open->id], Shift::open()->pluck('id')->all()); } public function test_scopes_can_be_chained(): void { $target = Shift::factory()->create(); Shift::factory()->inactive()->create(); Shift::factory()->forDoctor()->create(); Shift::factory()->forDoctor()->inactive()->create(); $this->assertSame([$target->id], Shift::active()->open()->pluck('id')->all()); } }