mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 12:33:56 +00:00
Update: laravel 8 to 12, php 7.3 to php 8.3, Jenkinsfile, Unit/Feature testing, vapor, docker
This commit is contained in:
+15
-15
@@ -13,7 +13,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
* @package App\Models
|
||||
* @version February 16, 2021, 9:04 pm
|
||||
*
|
||||
* @property string name
|
||||
* @property string $name
|
||||
*/
|
||||
class ServiceType extends AbstractModel
|
||||
{
|
||||
@@ -23,46 +23,46 @@ class ServiceType extends AbstractModel
|
||||
|
||||
protected $table = 'service_types';
|
||||
|
||||
|
||||
|
||||
protected $dates = ['deleted_at'];
|
||||
|
||||
|
||||
|
||||
public $fillable = [
|
||||
'name'
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be casted to native types.
|
||||
* Get the attributes that should be cast.
|
||||
*
|
||||
* @var array
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected $casts = [
|
||||
'name' => 'string'
|
||||
];
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'string',
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Validation rules
|
||||
*
|
||||
* @var array
|
||||
* @var array<string, string>
|
||||
*/
|
||||
public static $rules = [
|
||||
'name' => 'required'
|
||||
];
|
||||
|
||||
/**
|
||||
* @return hasMany
|
||||
* @return HasMany
|
||||
*/
|
||||
public function rates(): hasMany
|
||||
public function rates(): HasMany
|
||||
{
|
||||
return $this->hasMany(CurrencyRate::class, 'service_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return hasMany
|
||||
* @return HasMany
|
||||
*/
|
||||
public function constants(): hasMany
|
||||
public function constants(): HasMany
|
||||
{
|
||||
return $this->hasMany(SegmentConstant::class, 'detail->id')
|
||||
->whereIn('reference', [SegmentConstants::SERVICE_TYPE, SegmentConstants::CUSTOM_SERVICE_TYPE]);
|
||||
|
||||
Reference in New Issue
Block a user