Pro.php 414 B

12345678910111213141516171819202122
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. class Pro extends Model
  5. {
  6. protected $table = "pro";
  7. public function displayName() {
  8. $name = $this->name_last . ', '. $this->name_first;
  9. if(empty($name)) $name = $this->name_display;
  10. return $name;
  11. }
  12. public function company(){
  13. return $this->hasOne(Company::class, 'id', 'company_id');
  14. }
  15. }