neelkanthk/laravel-schedulable
Pros:
scheduled, unscheduled) enable seamless integration with existing Laravel event systems (e.g., notifications, logging).Cons:
Laravel Ecosystem Compatibility:
scheduled_at).Dependencies:
High:
where('scheduled_at', '>=', now())) could degrade performance if the table lacks proper indexing or if the dataset is large. Requires:
scheduled_at column.Medium:
Low:
spatie/laravel-schedule-with-jobs).spatie/laravel-schedule-with-jobs been evaluated? Why is this package preferred?Model::scheduled() can trigger notifications or analytics).Schedulable for models where query-time filtering is sufficient.scheduled_at column (or custom column name) in the target table. No migrations are provided; must be added manually.Artisan::schedule). These remain separate systems.scheduled_at column (or custom column) to target tables:
Schema::table('promotions', function (Blueprint $table) {
$table->timestamp('scheduled_at')->nullable()->after('updated_at');
});
Schedulable trait and optionally override default behavior:
use Neelkanthk\Schedulable\Schedulable;
class Promotion extends Model
{
use Schedulable;
// Override default column name if needed
protected $schedulableColumn = 'custom_schedule_time';
}
booted() method or a service provider:
public static function booted()
{
static::scheduled(function ($model) {
// Triggered when a model is scheduled
event(new PromotionScheduled($model));
});
}
$scheduledPromotions = Promotion::scheduled()->where('date', '>=', now())->get();
scheduled_at column.How can I help you explore Laravel packages today?