assignedToUser(User::factory()->create(['first_name' => 'Luke', 'last_name' => 'Skywalker'])) ->create(); $this->assertEquals('Luke Skywalker', $fieldOption->getValue($asset)); // If the "assignedTo" relationship was eager loaded then the way to get the // relationship changes from $asset->assignedTo to $asset->assigned. $this->assertEquals('Luke Skywalker', $fieldOption->getValue(Asset::with('assignedTo')->find($asset->id))); } }