diff --git a/app/Models/ServiceType.php b/app/Models/ServiceType.php new file mode 100644 index 00000000..ecc4750e --- /dev/null +++ b/app/Models/ServiceType.php @@ -0,0 +1,70 @@ + 'string' + ]; + + /** + * Validation rules + * + * @var array + */ + public static $rules = [ + 'name' => 'required' + ]; + + /** + * @return hasMany + */ + public function rates(): hasMany + { + return $this->hasMany(CurrencyRate::class, 'service_id'); + } + + /** + * @return hasMany + */ + public function constants(): hasMany + { + return $this->hasMany(SegmentConstant::class, 'detail->id') + ->whereIn('reference', [SegmentConstants::SERVICE_TYPE, SegmentConstants::CUSTOM_SERVICE_TYPE]); + } +}