Files
laraundfelix/app/Domain/Media/DeliveryLog.php
LarsandCursor c997eb500c
Deploy Test / test (push) Successful in 2m28s
Deploy Test / deploy (push) Failing after 14s
Leite Vorschaubilder und Filmstufen geschuetzt ab
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-16 09:40:59 +01:00

37 lines
1.0 KiB
PHP

<?php
namespace App\Domain\Media;
use App\Domain\Catalog\ArticleRelease;
use App\Domain\Catalog\ContentElementVersion;
use App\Domain\Catalog\LicenseArticle;
use App\Domain\Entitlement\Grant;
use App\Domain\Entitlement\MediaDelivery;
class DeliveryLog
{
public function write(
Grant $grant,
LicenseArticle $article,
ArticleRelease $release,
ContentElementVersion $version,
string $action,
string $format,
?string $checksum,
string $marking,
): MediaDelivery {
return MediaDelivery::query()->create([
'grant_id' => $grant->id,
'license_article_id' => $article->id,
'article_release_id' => $release->id,
'content_element_version_id' => $version->id,
'action' => $action,
'format' => $format,
'copy_id' => 'LK-'.strtoupper(bin2hex(random_bytes(6))),
'checksum' => $checksum,
'marking' => $marking,
'delivered_at' => now(),
]);
}
}