28 lines
630 B
PHP
28 lines
630 B
PHP
<?php
|
|||
|
|
|
||
|
|
namespace Rooyesh\Wallet\models;
|
||
|
|
|
||
|
|
use App\Models\Selector;
|
||
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
|
||
|
|
class Wallet extends Model
|
||
|
|
{
|
||
|
|
protected $guarded=['hash'];
|
||
|
|
use Selector;
|
||
|
|
|
||
|
|
use HasFactory;
|
||
|
|
public function customer()
|
||
|
|
{
|
||
|
|
return $this->belongsTo('App\Models\Customer','owner')->select(['id','name']);
|
||
|
|
}
|
||
|
|
public function fund()
|
||
|
|
{
|
||
|
|
return $this->belongsTo('App\Models\Fund','fund_id')->select(['id','title']);
|
||
|
|
}
|
||
|
|
public function Product()
|
||
|
|
{
|
||
|
|
return $this->belongsTo('App\Models\Product','product_id');
|
||
|
|
}
|
||
|
|
}
|