superuser()->create(); $asset = Asset::factory()->create(['last_checkin' => null]); $asset->checkOut(User::factory()->create(), $admin, now()); $this->actingAs($admin) ->post(route('hardware.checkin.store', [ 'assetId' => $asset->id, ])) ->assertRedirect(); $this->assertNotNull( $asset->fresh()->last_checkin, 'last_checkin field should be set on checkin' ); } }