mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 12:34:18 +00:00
77 lines
2.3 KiB
PHP
77 lines
2.3 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasOne;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
use Illuminate\Database\Eloquent\Relations\hasMany;
|
|
use Illuminate\Support\Carbon;
|
|
use Spatie\Activitylog\Models\Activity;
|
|
|
|
/**
|
|
* Class Currency
|
|
*
|
|
* @package App\Models
|
|
* @property Country country_id
|
|
* @property string name
|
|
* @property string short_code
|
|
* @property string symbol
|
|
* @property int $id
|
|
* @property Carbon|null $deleted_at
|
|
* @property Carbon|null $created_at
|
|
* @property Carbon|null $updated_at
|
|
* @property-read Collection|Activity[] $activities
|
|
* @property-read int|null $activities_count
|
|
* @property-read Model|\Eloquent $causer
|
|
* @property-read Country|null $country
|
|
* @property-read Collection|CurrencyRate[] $rates
|
|
* @property-read int|null $rates_count
|
|
* @property-read Model|\Eloquent $subject
|
|
* @property-read Model|\Eloquent $target
|
|
* @method static Builder|Currency newModelQuery()
|
|
* @method static Builder|Currency newQuery()
|
|
* @method static \Illuminate\Database\Query\Builder|Currency onlyTrashed()
|
|
* @method static Builder|Currency query()
|
|
* @method static Builder|Currency whereCountryId($value)
|
|
* @method static Builder|Currency whereCreatedAt($value)
|
|
* @method static Builder|Currency whereDeletedAt($value)
|
|
* @method static Builder|Currency whereId($value)
|
|
* @method static Builder|Currency whereName($value)
|
|
* @method static Builder|Currency whereShortCode($value)
|
|
* @method static Builder|Currency whereSymbol($value)
|
|
* @method static Builder|Currency whereUpdatedAt($value)
|
|
* @method static \Illuminate\Database\Query\Builder|Currency withTrashed()
|
|
* @method static \Illuminate\Database\Query\Builder|Currency withoutTrashed()
|
|
* @mixin \Eloquent
|
|
*/
|
|
|
|
class Currency extends AbstractModel
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'currencies';
|
|
|
|
protected $dates = ['deleted_at'];
|
|
|
|
/**
|
|
* @return BelongsTo
|
|
*/
|
|
public function country(): BelongsTo
|
|
{
|
|
return $this->BelongsTo(Country::class, 'country_id', 'id');
|
|
}
|
|
|
|
/**
|
|
* @return hasMany
|
|
*/
|
|
public function rates(): hasMany
|
|
{
|
|
return $this->hasMany(CurrencyRate::class, 'currency_id');
|
|
}
|
|
}
|