mirror of
https://gitlab.com/uldvstar/exchange-2.0.git
synced 2026-08-19 04:24:16 +00:00
e3e4b490b0
# Conflicts: # resources/views/partials/header.blade.php # routes/web.php
37 lines
907 B
PHP
37 lines
907 B
PHP
<?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();
|
|
}
|
|
public function company(): BelongsTo
|
|
{
|
|
return $this->BelongsTo(Company::class, 'owner_id', 'id');
|
|
}
|
|
|
|
/**
|
|
* @return morphMany
|
|
*/
|
|
public function transactions(): morphMany
|
|
{
|
|
return $this->morphMany(Transaction::class, 'owner');
|
|
}
|
|
}
|