Add join token TTL policy and Live Show link sharing
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Services;
|
||||
|
||||
use App\Models\Event;
|
||||
use App\Models\EventJoinToken;
|
||||
use App\Models\GuestPolicySetting;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
@@ -28,6 +29,12 @@ class EventJoinTokenService
|
||||
$payload['expires_at'] = $expiresAt instanceof Carbon
|
||||
? $expiresAt
|
||||
: Carbon::parse($expiresAt);
|
||||
} else {
|
||||
$ttlHours = (int) (GuestPolicySetting::current()->join_token_ttl_hours ?? 0);
|
||||
|
||||
if ($ttlHours > 0) {
|
||||
$payload['expires_at'] = now()->addHours($ttlHours);
|
||||
}
|
||||
}
|
||||
|
||||
if ($createdBy = Arr::get($attributes, 'created_by')) {
|
||||
|
||||
Reference in New Issue
Block a user