TestUser.php 345 B

12345678910111213141516171819
  1. <?php
  2. namespace Knuckles\Scribe\Tests\Fixtures;
  3. use Illuminate\Database\Eloquent\Model;
  4. class TestUser extends Model
  5. {
  6. public function children()
  7. {
  8. return $this->hasMany(TestUser::class, 'parent_id');
  9. }
  10. public function pets()
  11. {
  12. return $this->belongsToMany(TestPet::class)->withPivot('duration');
  13. }
  14. }