'boolean', 'request_params' => 'array', 'response_data' => 'array', ]; public function source(): BelongsTo { return $this->belongsTo(JobSource::class, 'job_source_id'); } /** * Scope to get only successful logs */ public function scopeSuccessful($query) { return $query->where('success', true); } /** * Scope to get only failed logs */ public function scopeFailed($query) { return $query->where('success', false); } /** * Scope to get logs within a date range */ public function scopeWithinDays($query, int $days) { return $query->where('created_at', '>=', now()->subDays($days)); } }