*/ protected $fillable = [ 'name', 'type', 'status', 'brand_id', ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'type' => CampaignTypes::class, 'status' => 'bool', ]; // * RELATIONS /** * Get the brand that owns the Campaign * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function brand(): BelongsTo { return $this->belongsTo(Brand::class); } /** * Get coupons that owned by the Campaign * * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function coupons(): BelongsToMany { return $this->belongsToMany(Coupon::class); } }