withDependency() : $class::factory(); $factory = empty($smash) ? $factory : $factory->smash($smash); $model = $factory->make($attrs)->makeVisible((new $class())->getHidden()); return $model->toArray(); return Arr::except($model->toArray(), $model->getAppends()); } public function one($class, $attributes = []) { return $class::factory()->createQuietly($attributes); } public function randomOne($class) { return $class::inRandomOrder()->first(); } public function trashed($class) { $model = $this->one($class); $model->delete(); $this->assertSoftDeleted($model); return $model; } }