You’re receiving the error because you are attempting to use the scope resolution operator (: to perform a scoped call to a non-static method (that’s privately set anyway).
If you’d like to invoke the GetUserPayments() method, then define it as a public static method:
public static function GetUserPayments($isPaid = false)
{
//eloquent stuff
return $results
}
With that said, defining things statically unnecessarily can quickly make your code base quite a mess. In your scenario, I’d personally use dependency injection where the Payment class (a model object?) is simply passed into the constructor of the controller and assigned to an instance variable. That way, it can be used by other methods of your controller classes without having scoped calls firing off everywhere.
Well your class is designed properly, but not used appropriately. Also learn how to use dependency injection and do not rely on static accesses, since statics are bad OOP practice and really aint about reusability.