BillingReport.php 671 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Relations\HasOne;
  4. use Illuminate\Support\Collection;
  5. # use Illuminate\Database\Eloquent\Model;
  6. class BillingReport extends Model
  7. {
  8. protected $table = 'billing_report';
  9. public function clientDisplayName()
  10. {
  11. return $this->client_last . ', ' . $this->client_first;
  12. }
  13. public function proDisplayName()
  14. {
  15. return $this->pro_last . ', ' . $this->pro_first;
  16. }
  17. public function note()
  18. {
  19. return $this->hasOne(Note::class, 'id', 'note_id');
  20. }
  21. public function client()
  22. {
  23. return $this->hasOne(Client::class, 'id', 'client_id');
  24. }
  25. }