card action

This commit is contained in:
2025-01-26 14:42:47 +03:00
parent 08cdf44b67
commit 824130df26
27 changed files with 430 additions and 53 deletions

View File

@ -14,7 +14,7 @@ use kernel\modules\user\models\User;
* @property int $payment_type
* @property int $bank_id
* @property int $info
* @property int $program
* @property int $card_program_id
* @property int $cvc
* @property int $pin
* @property int $card_template_id
@ -28,7 +28,7 @@ class Card extends Model
protected $table = 'card';
protected $fillable = ['user_id', 'payment_type', 'balance', 'bank_id', 'info', 'program', 'cvc', 'pin', 'username', 'card_template_id', 'card_file_id', 'status'];
protected $fillable = ['user_id', 'payment_type', 'balance', 'bank_id', 'info', 'card_program_id', 'cvc', 'pin', 'username', 'card_template_id', 'card_file_id', 'status'];
public static function labels(): array
{
@ -46,7 +46,7 @@ class Card extends Model
'balance' => 'Баланс',
'bank_id' => 'ID банка',
'info' => 'Информация о банке',
'program' => 'Программа',
'card_program_id' => 'Программа',
'cvc' => 'CVC',
'pin' => 'PIN',
'username' => 'Username',
@ -72,6 +72,11 @@ class Card extends Model
return $this->belongsTo(CardTemplate::class);
}
public function cardProgram(): \Illuminate\Database\Eloquent\Relations\BelongsTo
{
return $this->belongsTo(related: CardProgram::class);
}
public function cardFile(): \Illuminate\Database\Eloquent\Relations\BelongsTo
{
return $this->belongsTo(CardFile::class);