added owner relationship

This commit is contained in:
Denis Duliçi 2021-06-27 12:16:47 +03:00
parent 6b6e44371e
commit 9ad8780741

View File

@ -68,6 +68,16 @@ abstract class Model extends Eloquent implements Ownable
return $this->belongsTo('App\Models\Common\Company'); return $this->belongsTo('App\Models\Common\Company');
} }
/**
* Owner relation.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function owner()
{
return $this->belongsTo('App\Models\Auth\User', 'id', 'created_by');
}
/** /**
* Scope to only include company data. * Scope to only include company data.
* *