Skip to content

Commit

Permalink
Changes to files: app/Models/Meta.php
Browse files Browse the repository at this point in the history
app/Models/Partner.php
app/Models/Slug.php
app/Models/TypeRelation.php
  • Loading branch information
dedanirungu committed Sep 5, 2024
1 parent e07005b commit 8b78afd
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/Models/Meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Modules\Partner\Models;

use Modules\Base\Models\BaseModel;
use Modules\Partner\Models\Partner;

class Meta extends BaseModel
{
Expand All @@ -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);
}

}
40 changes: 40 additions & 0 deletions app/Models/Partner.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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);
}

}
10 changes: 10 additions & 0 deletions app/Models/Slug.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Modules\Partner\Models;

use Modules\Base\Models\BaseModel;
use Modules\Partner\Models\Partner;

class Slug extends BaseModel
{
Expand All @@ -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);
}

}
20 changes: 20 additions & 0 deletions app/Models/TypeRelation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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);
}

}

0 comments on commit 8b78afd

Please sign in to comment.