File: D:/HostingSpaces/netwerkbrabant/netwerkbrabant.nl/app/KommaApp/Orders/Models/OrderPayment.php
<?php
namespace App\KommaApp\Orders\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
class OrderPayment extends Model
{
const OPEN = 0;
const CANCELED = 1;
const PENDING = 2;
const AUTHORIZED = 3;
const EXPIRED = 4;
const FAILED = 5;
const PAID = 6;
protected $table = 'order_payments';
use SoftDeletes;
protected $guarded = ['id', 'order_id'];
/**
* Get the order belonging to this order
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function order(): BelongsTo
{
return $this->belongsTo(Order::class);
}
static function getStatus($statusName)
{
return constant('self::' . strtoupper($statusName));
}
}