31 lines
707 B
PHP
Executable File
31 lines
707 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Merchant extends Model
|
|
{
|
|
//
|
|
// protected $fillable = [
|
|
// 'fullname', 'phone', 'pin','country', 'language', 'org_id'
|
|
// ];
|
|
protected $guarded = [
|
|
'id'
|
|
];
|
|
|
|
public function transactions()
|
|
{
|
|
return $this->hasMany('App\Models\Transaction', 'merchant_id', 'id')->orderBy('created_at','desc')->take(10);
|
|
}
|
|
|
|
public function topups()
|
|
{
|
|
return $this->hasMany('App\Models\Topup', 'merchant_id', 'id')->orderBy('created_at','desc')->take(10);
|
|
}
|
|
public function orgInfo()
|
|
{
|
|
return $this->belongsTo('App\Models\Organisation', 'org_id', 'id');
|
|
}
|
|
}
|