route('session'); if (! $session instanceof CheckoutSession) { return false; } $user = $this->user(); if (! $user) { 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 [ // ]; } /** * Get custom validation messages. */ public function messages(): array { return [ 'session.required' => 'Checkout-Session fehlt.', ]; } }