fix service cant show
This commit is contained in:
@@ -17,6 +17,15 @@ class Service extends Model
|
||||
return ['uuid'];
|
||||
}
|
||||
|
||||
protected static function booted(): void
|
||||
{
|
||||
static::saving(function (Service $service) {
|
||||
if ($service->type === null && $service->product_id) {
|
||||
$service->type = Product::query()->where('id', $service->product_id)->value('product_type');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected $table = 'services';
|
||||
|
||||
public const HOSTING_ACCOUNT_RELATIONS = [
|
||||
|
||||
Reference in New Issue
Block a user