<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Campaign extends Model
{
    use HasFactory;

    protected $fillable = [
        'name',
        'segment_rules',
        'offer_text',
        'voucher_id',
        'status',
    ];

    protected $casts = [
        'segment_rules' => 'array',
    ];

    public function voucher()
    {
        return $this->belongsTo(Voucher::class);
    }
}
