您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

HasParentRelationship.php 468B

12345678910111213141516171819
  1. <?php
  2. namespace Database\Factories\Concerns;
  3. use Illuminate\Database\Eloquent\Model;
  4. trait HasParentRelationship
  5. {
  6. public function useParentCompany(): self
  7. {
  8. return $this->state(function (array $attributes, Model $parent) {
  9. return [
  10. 'company_id' => $parent->company_id,
  11. 'created_by' => $parent->created_by ?? 1,
  12. 'updated_by' => $parent->updated_by ?? 1,
  13. ];
  14. });
  15. }
  16. }