Note.php 659 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace App\Models;
  3. # use Illuminate\Database\Eloquent\Model;
  4. class Note extends Model
  5. {
  6. protected $table = "note";
  7. public function client()
  8. {
  9. return $this->hasOne(Client::class, 'id', 'client_id');
  10. }
  11. public function hcpPro()
  12. {
  13. return $this->hasOne(Pro::class, 'id', 'hcp_pro_id');
  14. }
  15. public function allyPro()
  16. {
  17. return $this->hasOne(Pro::class, 'id', 'ally_pro_id');
  18. }
  19. public function bills()
  20. {
  21. return $this->hasMany(Bill::class, 'note_id', 'id');
  22. }
  23. public function sections()
  24. {
  25. return $this->hasMany(Section::class, 'note_id', 'id');
  26. }
  27. }