| namespace App\Models; | |
| use Illuminate\Database\Eloquent\Factories\HasFactory; | |
| use Illuminate\Database\Eloquent\Model; | |
| use Illuminate\Database\Eloquent\Relations\BelongsTo; | |
| class SocialRecurringAlert extends Model | |
| { | |
| use HasFactory; | |
| protected $fillable = [ | |
| 'user_id', | |
| 'social_recurring_campaign_id', | |
| 'type', | |
| 'title', | |
| 'message', | |
| 'context', | |
| 'read_at', | |
| ]; | |
| protected $casts = [ | |
| 'context' => 'array', | |
| 'read_at' => 'datetime', | |
| ]; | |
| public function user(): BelongsTo | |
| { | |
| return $this->belongsTo(User::class); | |
| } | |
| public function recurringCampaign(): BelongsTo | |
| { | |
| return $this->belongsTo(SocialRecurringCampaign::class, 'social_recurring_campaign_id'); | |
| } | |
| } | |