Initial commit
This commit is contained in:
30
app/Models/Merchant.php
Executable file
30
app/Models/Merchant.php
Executable file
@@ -0,0 +1,30 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user