Files
2023-04-24 13:56:00 +03:00

80 lines
2.8 KiB
PHP

<?php
namespace App\Models;
use App\Classes\General\Interfaces\DataTransferObject;
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\SoftDeletes;
use Illuminate\Database\Eloquent\Relations\MorphTo;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Support\Carbon;
use Spatie\Activitylog\Models\Activity;
/**
* App\Models\BankAccount
*
* @property int $id
* @property string $owner_type
* @property int $owner_id
* @property int $country_id
* @property string $bank_name
* @property string|null $bank_branch
* @property string $account_name
* @property string $account_number
* @property int $type
* @property int $default
* @property int $status
* @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 Model|\Eloquent $owner
* @property-read Model|\Eloquent $subject
* @property-read Model|\Eloquent $target
* @method static Builder|BankAccount newModelQuery()
* @method static Builder|BankAccount newQuery()
* @method static \Illuminate\Database\Query\Builder|BankAccount onlyTrashed()
* @method static Builder|BankAccount query()
* @method static Builder|BankAccount whereAccountName($value)
* @method static Builder|BankAccount whereAccountNumber($value)
* @method static Builder|BankAccount whereBankBranch($value)
* @method static Builder|BankAccount whereBankName($value)
* @method static Builder|BankAccount whereCountryId($value)
* @method static Builder|BankAccount whereCreatedAt($value)
* @method static Builder|BankAccount whereDefault($value)
* @method static Builder|BankAccount whereDeletedAt($value)
* @method static Builder|BankAccount whereId($value)
* @method static Builder|BankAccount whereOwnerId($value)
* @method static Builder|BankAccount whereOwnerType($value)
* @method static Builder|BankAccount whereStatus($value)
* @method static Builder|BankAccount whereType($value)
* @method static Builder|BankAccount whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|BankAccount withTrashed()
* @method static \Illuminate\Database\Query\Builder|BankAccount withoutTrashed()
* @mixin \Eloquent
*/
class BankAccount extends AbstractModel implements DataTransferObject
{
use SoftDeletes;
protected $table = 'bank_accounts';
public function country(): HasOne
{
return $this->hasOne(Country::class, 'country_id', 'id');
}
public function owner(): morphTo
{
return $this->morphTo();
}
}