TestUser.php 407 B

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