mirror of
https://github.com/cupcakearmy/coolify.git
synced 2024-10-23 00:24:15 +02:00
fix: server saving
This commit is contained in:
parent
9c22e01716
commit
3dab1eb92e
@ -17,10 +17,14 @@ class Server extends BaseModel
|
|||||||
protected static function booted()
|
protected static function booted()
|
||||||
{
|
{
|
||||||
static::saving(function ($server) {
|
static::saving(function ($server) {
|
||||||
$server->forceFill([
|
$payload = [];
|
||||||
'ip' => Str::of($server->ip)->trim(),
|
if ($server->user) {
|
||||||
'user' => Str::of($server->user)->trim(),
|
$payload['user'] = Str::of($server->user)->trim();
|
||||||
]);
|
}
|
||||||
|
if ($server->ip) {
|
||||||
|
$payload['ip'] = Str::of($server->ip)->trim();
|
||||||
|
}
|
||||||
|
$server->forceFill($payload);
|
||||||
});
|
});
|
||||||
|
|
||||||
static::created(function ($server) {
|
static::created(function ($server) {
|
||||||
|
Loading…
Reference in New Issue
Block a user