Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Support custom models for schedule monitor #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

doubleoh13
Copy link

@doubleoh13 doubleoh13 commented Sep 24, 2024

Description

This Pull Request addresses the issue where the package is tightly coupled with Spatie\ScheduleMonitor\Models\MonitoredScheduledTask and Spatie\ScheduleMonitor\Models\MonitoredScheduledTaskLogItem. While the spatie/laravel-schedule-monitor package allows users to specify custom models for these tables via configuration, the package currently fails to respect those configurations and continues to use the default models.

Problem

When custom models are specified in the config/schedule-monitor.php file, the package does not switch to using the configured models. This leads to errors when different table names are used.

Solution

This fix modifies the package to use the custom models specified in the configuration file for MonitoredScheduledTask and MonitoredScheduledTaskLogItem.
All references to the default models have been replaced with dynamic lookups, ensuring that custom models will be used if defined in the config.
Impact
This change ensures that users with custom models or table structures for scheduled tasks can still use the package without issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant