superuser()->create(); $asset = Asset::factory()->create(['last_checkin' => null]); $asset->checkOut(User::factory()->create(), $admin, now()); $this->actingAsForApi($admin) ->postJson(route('api.asset.checkin', $asset)) ->assertOk(); $this->assertNotNull( $asset->fresh()->last_checkin, 'last_checkin field should be set on checkin' ); } }