sebastian/peek-and-poke
sebastian/peek-and-poke is a small PHP utility that uses reflection to peek at and poke into objects. It lets you read and write private and protected properties, making it handy for tests that need to inspect or set up object state without changing production code.
sebastian/peek-and-poke is a small PHP library that uses reflection to peek at and poke into the private and protected members of objects. By wrapping an object in a Proxy, you can read or write otherwise inaccessible properties and invoke non-public methods without modifying the class under test—ideal for unit testing legacy or tightly encapsulated code.
$proxy = new SebastianBergmann\PeekAndPoke\Proxy($object);
$proxy->privateProperty = 'value'; // poke
echo $proxy->privateProperty; // peek
How can I help you explore Laravel packages today?