update api register
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class VoucherAgent extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'discount_percent' => 'decimal:2', 'commission_percent' => 'decimal:2',
|
||||
'credit_limit' => 'decimal:2', 'outstanding_balance' => 'decimal:2',
|
||||
];
|
||||
}
|
||||
|
||||
public function tenant()
|
||||
{
|
||||
return $this->belongsTo(Tenant::class);
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function sales()
|
||||
{
|
||||
return $this->hasMany(VoucherSale::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user