Files
airtime-reseller/app/Models/Merchant.php
Kwesi Banson Jnr 2cfcfade4e Initial commit
2026-08-04 14:50:01 +00:00

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');
}
}