(string) new Cuid2, 'database_id' => $database->id, 'database_type' => $database->getMorphClass(), 'engine' => 'pgbackrest', 'scheduled_database_backup_execution_id' => $execution?->id, 'target_label' => $execution?->pgbackrest_label, 'target_time' => $targetTime, 'status' => 'pending', ]); PgBackrestRestoreJob::dispatch($database, $restore, $execution, $targetTime); return $restore; } public function rules(): array { return [ 'database' => ['required'], 'targetTime' => ['nullable', 'date'], ]; } }