123456789101112131415161718192021222324252627 |
- <?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');
- }
- public function companyPros()
- {
- return $this->hasMany(CompanyPro::class, 'pro_id', 'id');
- }
- }
|