Enth\u00e4lt gemischt: Laravel-10-Upgrade + Phase 1 (Contacts-Modul, Duplicats-Commands, Soft-Delete+Merge-Fields) + Phase 2 Code-Umstellungen (inquiry_id, $table='contacts'/'inquiries') + Offers-Modul (Migrationen, Models, offer_id in Booking, offer-Disk in filesystems.php). Phase 2 + Offers werden im folgenden Commit nach dev/backups/phase2-offers-2026-04-17/ verschoben, damit der Workspace auf Phase-1-only (= Test-System-Stand) reduziert ist und direkt auf Live deploybar wird. Tarball-Backup zus\u00e4tzlich unter: ../backups-safety/workspace-pre-phase1-rollback-2026-04-17.tar.gz Made-with: Cursor
51 lines
1.4 KiB
PHP
51 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Services;
|
|
|
|
use App\Models\CMSContent;
|
|
use App\Models\LeadMail;
|
|
|
|
class Lead
|
|
{
|
|
public static function contentFiles(): \Illuminate\Support\Collection
|
|
{
|
|
return CMSContent::where('identifier', '=', 'lead-email-file')
|
|
->get()
|
|
->sortByDesc('pos')
|
|
->pluck('slug', 'id');
|
|
}
|
|
|
|
public static function setOutputDirs(string $dir, string $subdir): void
|
|
{
|
|
MailDirService::setOutputDir($dir, $subdir);
|
|
}
|
|
|
|
/**
|
|
* @return string[]
|
|
*/
|
|
public static function getMailDirNotInOutput(int $leadId, string $dir): array
|
|
{
|
|
$mails = LeadMail::whereLeadId($leadId)->whereDir($dir)->get();
|
|
return MailDirService::getMailDirsNotInOutput($mails, $dir);
|
|
}
|
|
|
|
public static function getCustomerMailDirs(): \Illuminate\Database\Eloquent\Collection
|
|
{
|
|
return MailDirService::getCustomerMailDirs();
|
|
}
|
|
|
|
public static function getCustomerMailDir(int $id): ?\App\Models\CMSContent
|
|
{
|
|
return MailDirService::getCustomerMailDir($id);
|
|
}
|
|
|
|
public static function getCustomerMailName(\App\Models\CMSContent $mailDir, int $mailDirId): string
|
|
{
|
|
return MailDirService::getCustomerMailName($mailDir, $mailDirId);
|
|
}
|
|
|
|
public static function getCustomerMailEmails(\App\Models\CMSContent $mailDir, int $mailDirId): array|string
|
|
{
|
|
return MailDirService::getCustomerMailEmails($mailDir, $mailDirId);
|
|
}
|
|
}
|