|ShoppingPayment whereReminder($value) * @method static \Illuminate\Database\Eloquent\Builder|ShoppingPayment whereReminderDate($value) * * @mixin \Eloquent */ class ShoppingPayment extends Model { protected $table = 'shopping_payments'; protected $fillable = [ 'shopping_order_id', 'clearingtype', 'wallettype', 'onlinebanktransfertype', 'reference', 'amount', 'currency', 'status', 'reminder', 'reminder_date', 'txaction', 'mode', ]; protected $casts = [ 'reminder' => 'integer', 'reminder_date' => 'datetime', ]; public function shopping_order() { return $this->belongsTo('App\Models\ShoppingOrder', 'shopping_order_id'); } public function payment_transactions() { return $this->hasMany('App\Models\PaymentTransaction', 'shopping_payment_id'); } public function getPaymentType() { if ($this->clearingtype === 'pp') { return 'PayPal'; } if ($this->clearingtype === 'cc') { return 'Kreditkarte'; } if ($this->clearingtype === 'vor') { return 'Vorkasse'; } if ($this->clearingtype === 'elv') { return 'SEPA Lastschrift'; } if ($this->clearingtype === 'sb') { return 'Sofort Überweisung'; } if ($this->clearingtype === 'fnc') { return 'Rechnung'; } if ($this->clearingtype === 'non') { return 'keine'; } return 'keine'; } public function getPaymentAmount() { return Util::formatNumber($this->amount / 100).' '.$this->currency; } }