'boolean', 'last_sent_at' => 'datetime', ]; /** * Get the user who created the alert. */ public function user(): BelongsTo { return $this->belongsTo(User::class); } /** * Get the category for this alert. */ public function category(): BelongsTo { return $this->belongsTo(JobCategory::class, 'job_category_id'); } /** * Scope a query to only include active alerts. */ public function scopeActive($query) { return $query->where('is_active', true); } }