helpers.php 350 B

123456789101112131415
  1. <?php
  2. declare(strict_types=1);
  3. use Hyperf\Testing\ModelFactory;
  4. use Hypervel\Context\ApplicationContext;
  5. if (! function_exists('factory')) {
  6. function factory(string $class, mixed ...$arguments)
  7. {
  8. return ApplicationContext::getContainer()
  9. ->get(ModelFactory::class)
  10. ->factory($class, ...$arguments);
  11. }
  12. }