diff --git a/app/Models/Currency.php b/app/Models/Currency.php new file mode 100644 index 00000000..cf3b4a6f --- /dev/null +++ b/app/Models/Currency.php @@ -0,0 +1,44 @@ +BelongsTo(Country::class, 'country_id', 'id'); + } + + /** + * @return hasMany + */ + public function rates(): hasMany + { + return $this->hasMany(CurrencyRate::class, 'currency_id'); + } +} diff --git a/app/Models/PasswordReset.php b/app/Models/PasswordReset.php new file mode 100644 index 00000000..6ab27179 --- /dev/null +++ b/app/Models/PasswordReset.php @@ -0,0 +1,25 @@ +where('is_expired', false)->where('is_complete', false); + } + + /** + * @return BelongsTo + */ + public function user(): BelongsTo { + return $this->belongsTo(User::class, 'user_id', 'id'); + } +} diff --git a/app/Models/SegmentCompany.php b/app/Models/SegmentCompany.php new file mode 100644 index 00000000..660057fc --- /dev/null +++ b/app/Models/SegmentCompany.php @@ -0,0 +1,8 @@ +BelongsTo(Segment::class, 'segment_id', 'id'); + } + + /** + * @return mixed + */ + public function service(){ + return $this->hasOne(ServiceType::class, 'id', 'detail->id') + ->whereIn('reference', [SegmentConstants::SERVICE_TYPE, SegmentConstants::CUSTOM_SERVICE_TYPE]); + } + + + +}