<?php

namespace App\Models;

use App\Classes\General\Interfaces\Transactionable;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphTo;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\MorphMany;

class Wallet extends AbstractModel implements Transactionable
{
    use SoftDeletes;

    protected $table = 'wallets';
    /**
     * @return \Illuminate\Database\Eloquent\Relations\MorphTo
     */
    public function owner(): morphTo
    {
        return $this->morphTo();
    }

     /**
     * @return morphMany
     */
    public function transactions(): morphMany
    {
        return $this->morphMany(Transaction::class, 'owner');
    }
}
