Laravel Model Factory without connection to database
问题 I would like to use Laravel's Model Factory in some PHPUnit tests. The only thing I want to do is make a Model instance without saving it to database. Why the Model Factory needs connection to database? These tests must pass on CI environment without configured database. When I create Model manually by new App\Model($dataArray) , tests pass and the connection is not needed. I am using Model Factory in other places, so I would like to reuse it in that tests, to avoid code duplication. I am