Closed foglerek closed 6 years ago
This edit simply passes through any arguments provided during factory calls, i.e ...
Factory::method('Model', $overrides);
... on to the factory definition callback, if provided:
$factory('Model', function($faker, $overrides) { ... });
... or an empty array by default.
This allows for customising factory behaviour and conditionally creating relational models within the factory definition callback.
This also opens up the door for creating more complex generators in the callback, that can perform custom logic based on the passed $overrides data.
This edit simply passes through any arguments provided during factory calls, i.e ...
... on to the factory definition callback, if provided:
... or an empty array by default.
This allows for customising factory behaviour and conditionally creating relational models within the factory definition callback.
This also opens up the door for creating more complex generators in the callback, that can perform custom logic based on the passed $overrides data.