mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 20:43:56 +00:00
31 lines
633 B
PHP
31 lines
633 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class Group extends Model
|
|
{
|
|
public function transactions()
|
|
{
|
|
return $this->belongsToMany(Transaction::class, GroupTransaction::class);
|
|
}
|
|
|
|
/**
|
|
* @return BelongsTo
|
|
*/
|
|
public function currency(): BelongsTo
|
|
{
|
|
return $this->BelongsTo(Currency::class, 'currency_id', 'id');
|
|
}
|
|
|
|
/**
|
|
* @return BelongsTo
|
|
*/
|
|
public function original_currency(): BelongsTo
|
|
{
|
|
return $this->BelongsTo(Currency::class, 'original_currency_id', 'id');
|
|
}
|
|
}
|