I have spent the last hour googling and reading stack posts on this problem, but have been unable to resolve this issue. I attached a try catch and an if statement and I still am getting the call to member function on null error
. Here is my code
try{
$user = Auth::user();
if(null !== ($user->wasStripePlan())){
$data['allSubscriptions'] = (Auth::user()->wasStripePlan()) ? Auth::user()->subscriptions : [];
}
}catch (\PDOException $e){
$data['allSubscriptions'] = false;
}
Any ideas on solutions?