Closed clphillips closed 9 years ago
It may be necessary to access the key for a particular label. For instance:
products id, name, price
inventory id, number, qty
Where inventory.number is composed of ID + products.id. Assume products.id =123, then inventory.number = ID123.
Here's how we we'd implement that in the seed file:
<?php return [ 'inventory.123' => [ 'number' => function () { return 'ID' . Fixture::getInstance()->getDriver() ->generateKey('123', 'products'); } ] ];
It may be necessary to access the key for a particular label. For instance:
products id, name, price
inventory id, number, qty
Where inventory.number is composed of ID + products.id. Assume products.id =123, then inventory.number = ID123.
Here's how we we'd implement that in the seed file: