Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

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. }