![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/rentpix.corals.io/vendor/orchestra/testbench-core/src/Concerns/ |
<?php namespace Orchestra\Testbench\Concerns; use Exception; use Illuminate\Database\Eloquent\Factory as ModelFactory; use Orchestra\Testbench\Exceptions\ApplicationNotAvailableException; /** * @api * * @deprecated */ trait WithFactories { /** * Load model factories from path. * * @param string $path * @return $this * * @throws \Exception */ protected function withFactories(string $path) { if (\is_null($this->app)) { throw ApplicationNotAvailableException::make(__METHOD__); } return $this->loadFactoriesUsing($this->app, $path); } /** * Load model factories from path using Application. * * @param \Illuminate\Contracts\Foundation\Application $app * @param string $path * @return $this * * @throws \Exception */ protected function loadFactoriesUsing($app, string $path) { if (! class_exists(ModelFactory::class)) { throw new Exception(<<<'requirement' Missing `laravel/legacy-factories` in composer.json. Please refer to <https://packages.tools/testbench/troubleshooting.html#class-illuminate-database-eloquent-factory-not-found> requirement); } $app->make(ModelFactory::class)->load($path); return $this; } }