35 lines
725 B
PHP
35 lines
725 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Payment extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'payment';
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'accountNo',
|
|
'bankName',
|
|
'bankCode',
|
|
'type',
|
|
'logo',
|
|
'status'
|
|
];
|
|
public function invoice()
|
|
{
|
|
return $this->belongsTo(\App\Models\Invoice::class);
|
|
}
|
|
public function getStatus()
|
|
{
|
|
return match ($this->attributes['status']) {
|
|
1 => '<span class="badge bg-success">Active</span>',
|
|
default => '<span class="badge bg-secondary">InActive</span>'
|
|
};
|
|
}
|
|
}
|