Client.php 481 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Relations\HasOne;
  4. # use Illuminate\Database\Eloquent\Model;
  5. class Client extends Model
  6. {
  7. protected $table = 'client';
  8. public function displayName(){
  9. return $this->name_last . ', '. $this->name_first;
  10. }
  11. public function mcp(){
  12. return $this->hasOne(Pro::class, 'id', 'mcp_pro_id');
  13. }
  14. public function cm(){
  15. return $this->hasOne(Pro::class, 'id', 'cm_pro_id');
  16. }
  17. }