Click here to Skip to main content
15,881,204 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
/home/ssmkngbx/domains/royaleg.co/public_html/platform/plugins/real-estate/src/Providers/HookServiceProvider.php
                        app(TransactionInterface::class)->createOrUpdate([
                            'user_id' => 0,
                            'account_id' => $payment->customer_id,
                            'credits' => $package->number_of_listings,
                            'payment_id' => $payment ? $payment->id : null,
                        ]);
                    }
                }, 123, 2);
            }
 
            if (defined('PAYMENT_FILTER_PAYMENT_DATA')) {
                add_filter(PAYMENT_FILTER_PAYMENT_DATA, function (array $data, Request $request) {
                    $orderIds = [session('subscribed_packaged_id')];
 
                    $package = $this->app->make(PackageInterface::class)
                        ->findById(Arr::first($orderIds));
 
                    $products = [
                        [
                          'id' => $package->id,
                            'name' => $package->name,
                            'price' => $package->price,
                            'price_per_order' => $package->price,
                            'qty' => 1,
                        ],
                    ];
 
                    $account = auth('account')->user();
 
                    $address = [
                        'name' => $account->name,
                        'email' => $account->email,
                        'phone' => $account->phone,
                        'country' => null,
                        'state' => null,
                        'city' => null,
                        'address' => null,
                        'zip' => null,
                    ];
 
Arguments
"Attempt to read property "id" on null"


What I have tried:

help me to fix this error,
I don't how to fix it
Posted
Updated 22-Dec-22 7:41am

1 solution

You're code is assuming some operation was successful in returning an object when it didn't. You're then trying to access a property or call a method on that object. Since it is null (does not exist), you get the error you're asking about.

Nobody can tell you what the problem is because that cannot run your code and with your data. YOU have to find out what is null, then work backwards, examining the code to see why it is null.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900