diff --git a/app/Abstracts/Model.php b/app/Abstracts/Model.php index c8d2c1396..ed2c7244c 100644 --- a/app/Abstracts/Model.php +++ b/app/Abstracts/Model.php @@ -68,6 +68,16 @@ abstract class Model extends Eloquent implements Ownable 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. *