Set the name to the first part of the domain
This commit is contained in:
parent
d32d0692f8
commit
db9b3e9b67
@ -38,7 +38,9 @@ class CreateNode extends CreateRecord
|
|||||||
})
|
})
|
||||||
->helperText(fn ($state) => is_ip($state) ? 'You can also enter in the domain name instead!' : 'You can also enter the IP address instead!')
|
->helperText(fn ($state) => is_ip($state) ? 'You can also enter in the domain name instead!' : 'You can also enter the IP address instead!')
|
||||||
->afterStateUpdated(function (Forms\Set $set, ?string $state) {
|
->afterStateUpdated(function (Forms\Set $set, ?string $state) {
|
||||||
$set('name', $state);
|
[$subdomain] = str($state)->explode('.', 2);
|
||||||
|
|
||||||
|
$set('name', $subdomain);
|
||||||
})
|
})
|
||||||
->maxLength(191),
|
->maxLength(191),
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user