user(); if (! $user) { return false; } $sessionId = $this->input('checkout_session_id'); if (! is_string($sessionId) || $sessionId === '') { return false; } $session = CheckoutSession::find($sessionId); if (! $session) { return false; } return (int) $session->user_id === (int) $user->id; } /** * Get the validation rules that apply to the request. * * @return array|string> */ public function rules(): array { return [ 'checkout_session_id' => ['required', 'uuid', 'exists:checkout_sessions,id'], 'order_id' => ['required', 'string'], ]; } public function messages(): array { return [ 'checkout_session_id.required' => 'Checkout-Session fehlt.', 'order_id.required' => 'Order ID fehlt.', ]; } }