diff --git a/app/Models/Meta.php b/app/Models/Meta.php index ecdebea..134ff0b 100755 --- a/app/Models/Meta.php +++ b/app/Models/Meta.php @@ -3,6 +3,7 @@ namespace Modules\Partner\Models; use Modules\Base\Models\BaseModel; +use Modules\Partner\Models\Partner; class Meta extends BaseModel { @@ -20,4 +21,13 @@ class Meta extends BaseModel */ protected $table = "partner_meta"; + /** + * Add relationship to Partner + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function partner() + { + return $this->belongsTo(Partner::class); + } + } diff --git a/app/Models/Partner.php b/app/Models/Partner.php index 353abc2..d2c2348 100755 --- a/app/Models/Partner.php +++ b/app/Models/Partner.php @@ -3,6 +3,10 @@ namespace Modules\Partner\Models; use Modules\Base\Models\BaseModel; +use Modules\Core\Models\Country; +use Modules\Core\Models\Currency; +use Modules\Partner\Models\Meta; +use App\Models\User;s class Partner extends BaseModel { @@ -24,4 +28,40 @@ class Partner extends BaseModel */ protected $table = "partner"; + /** + * Add relationship to Meta + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ + public function meta() + { + return $this->hasMany(Meta::class); + } + + /** + * Add relationship to Country + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function country() + { + return $this->belongsTo(Country::class); + } + + /** + * Add relationship to Currency + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function currency() + { + return $this->belongsTo(Currency::class); + } + + /** + * Add relationship to User + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function user() + { + return $this->belongsTo(User::class); + } + } diff --git a/app/Models/Slug.php b/app/Models/Slug.php index 8ec423a..4de2cb6 100755 --- a/app/Models/Slug.php +++ b/app/Models/Slug.php @@ -3,6 +3,7 @@ namespace Modules\Partner\Models; use Modules\Base\Models\BaseModel; +use Modules\Partner\Models\Partner; class Slug extends BaseModel { @@ -20,4 +21,13 @@ class Slug extends BaseModel */ protected $table = "partner_slug"; + /** + * Add relationship to Partner + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function partner() + { + return $this->belongsTo(Partner::class); + } + } diff --git a/app/Models/TypeRelation.php b/app/Models/TypeRelation.php index 0929bdd..e802a29 100755 --- a/app/Models/TypeRelation.php +++ b/app/Models/TypeRelation.php @@ -3,6 +3,8 @@ namespace Modules\Partner\Models; use Modules\Base\Models\BaseModel; +use Modules\Partner\Models\Partner; +use Modules\Partner\Models\PartnerType; class TypeRelation extends BaseModel { @@ -20,4 +22,22 @@ class TypeRelation extends BaseModel */ protected $table = "partner_type_relation"; + /** + * Add relationship to Partner + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function partner() + { + return $this->belongsTo(Partner::class); + } + + /** + * Add relationship to PartnerType + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function partnerType() + { + return $this->belongsTo(PartnerType::class); + } + }