PHP Classes

File: server/app/Models/Payment.php

Recommend this page to a friend!
  Classes of mohammad anzawi   PHP Wallet API and Application   server/app/Models/Payment.php   Download  
File: server/app/Models/Payment.php
Role: Class source
Content type: text/plain
Description: Class source
Class: PHP Wallet API and Application
Application to manage a wallet by calling an API
Author: By
Last change:
Date: 2 years ago
Size: 850 bytes
 

Contents

Class file image Download
<?php

namespace App\Models;

use
Illuminate\Database\Eloquent\Factories\HasFactory;
use
Illuminate\Database\Eloquent\Model;

/**
 * Model to manage payments table
 */
class Payment extends Model
{
    use
HasFactory;

    protected
$fillable = [
       
'name',
       
'slug',
       
'currencies',
       
'min_deposit',
       
'max_deposit',
       
'max_withdrawal',
       
'min_withdrawal',
       
'img'
   
];

   
/**
     * change key when we're using route injection (binding) for payment model
     * @return string
     */
   
public function getRouteKeyName()
    {
        return
'slug';
    }

   
/**
     * create relation with \App\Models\Transactions::class
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
   
public function transaction()
    {
        return
$this->hasMany(Transaction::class);
    }
}