First Commit
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\AffiliatesAdmin\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AffiliateBanner extends Model
|
||||
{
|
||||
protected $table = 'affiliate_banners';
|
||||
|
||||
protected $primaryKey = 'affiliate_banners_id';
|
||||
|
||||
protected $fillable = [
|
||||
'affiliate_banners_name',
|
||||
'affiliate_banners_description',
|
||||
'affiliate_banners_image_url',
|
||||
'affiliate_banners_target_url',
|
||||
'affiliate_banners_width',
|
||||
'affiliate_banners_height',
|
||||
'affiliate_banners_is_active',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the affiliate that owns the banner.
|
||||
*/
|
||||
public function affiliate()
|
||||
{
|
||||
return $this->belongsTo(Affiliate::class, 'affiliate_banners_affiliate_id', 'affiliates_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the clicks for the banner.
|
||||
*/
|
||||
public function clicks()
|
||||
{
|
||||
return $this->hasMany(AffiliateClick::class, 'affiliate_clicks_banner_id', 'affiliate_banners_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user