mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-24 06:54:02 +00:00
Wallet operations
This commit is contained in:
@@ -10,18 +10,41 @@ use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
|
||||
|
||||
class Transaction extends AbstractModel implements Documentable
|
||||
{
|
||||
protected $table = 'transactions';
|
||||
|
||||
public function owner(): morphTo
|
||||
{
|
||||
return $this->morphTo();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return MorphMany
|
||||
*/
|
||||
public function booking(): morphMany
|
||||
{
|
||||
//return $this->BelongsTo( Booking::class, 'booking_id', 'id');
|
||||
return $this->morphMany(Booking::class, 'owner');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return MorphMany
|
||||
*/
|
||||
public function wallets(): morphMany
|
||||
{
|
||||
return $this->morphMany(Wallet::class, 'owner');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function booking(): BelongsTo
|
||||
public function wallet(): BelongsTo
|
||||
{
|
||||
return $this->BelongsTo( Booking::class, 'booking_id', 'id');
|
||||
return $this->BelongsTo(Wallet::class, 'owner_id', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user