belongsTo('App\Models\Gateway'); } public function getCreditcardTypes() { $flags = unserialize(CREDIT_CARDS); $arrayOfImages = []; foreach ($flags as $card => $name) { if (($this->accepted_credit_cards & $card) == $card) { $arrayOfImages[] = ['source' => asset($name['card']), 'alt' => $name['text']]; } } return $arrayOfImages; } public function getPaymentType() { return Gateway::getPaymentType($this->gateway_id); } public function isPaymentType($type) { return $this->getPaymentType() == $type; } }