12345678910111213141516171819202122 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- class Pro extends Model
- {
- protected $table = "pro";
- public function displayName() {
- $name = $this->name_last . ', '. $this->name_first;
- if(empty($name)) $name = $this->name_display;
- return $name;
- }
- public function company(){
- return $this->hasOne(Company::class, 'id', 'company_id');
- }
- }
|