Add guest policy settings
This commit is contained in:
@@ -9,6 +9,7 @@ use App\Http\Requests\Tenant\BroadcastGuestNotificationRequest;
|
||||
use App\Http\Resources\Tenant\GuestNotificationResource;
|
||||
use App\Models\Event;
|
||||
use App\Models\GuestNotification;
|
||||
use App\Models\GuestPolicySetting;
|
||||
use App\Services\GuestNotificationService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -55,6 +56,11 @@ class EventGuestNotificationController extends Controller
|
||||
$expiresAt = null;
|
||||
if (! empty($data['expires_in_minutes'])) {
|
||||
$expiresAt = now()->addMinutes((int) $data['expires_in_minutes']);
|
||||
} else {
|
||||
$policyTtl = GuestPolicySetting::current()->guest_notification_ttl_hours;
|
||||
if ($policyTtl !== null && $policyTtl > 0) {
|
||||
$expiresAt = now()->addHours((int) $policyTtl);
|
||||
}
|
||||
}
|
||||
|
||||
$payload = null;
|
||||
|
||||
Reference in New Issue
Block a user