mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-28 17:04:06 +00:00
49 lines
1.2 KiB
PHP
49 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Eloquent;
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\HasOne;
|
|
use Spatie\Activitylog\Models\Activity;
|
|
|
|
|
|
/**
|
|
* App\Models\Receipt
|
|
*
|
|
* @property-read Collection|Activity[] $activities
|
|
* @property-read int|null $activities_count
|
|
* @property-read Model|Eloquent $causer
|
|
* @property-read Currency|null $currency
|
|
* @property-read Currency|null $original_currency
|
|
* @property-read Model|Eloquent $subject
|
|
* @property-read Model|Eloquent $target
|
|
* @property-read Transaction|null $transaction
|
|
* @method static Builder|Receipt newModelQuery()
|
|
* @method static Builder|Receipt newQuery()
|
|
* @method static Builder|Receipt query()
|
|
* @mixin Eloquent
|
|
*/
|
|
class Receipt extends AbstractModel
|
|
{
|
|
protected $table = 'receipt';
|
|
|
|
public function transaction(): HasOne
|
|
{
|
|
return $this->hasOne(Transaction::class, 'transaction_id', 'id');
|
|
}
|
|
|
|
public function currency(): HasOne
|
|
{
|
|
return $this->hasOne(Currency::class, 'currency_id', 'id');
|
|
}
|
|
|
|
public function original_currency(): HasOne
|
|
{
|
|
return $this->hasOne(Currency::class, 'original_currency_id', 'id');
|
|
}
|
|
|
|
}
|