Make sure the subfleet type field doesn't have spaces
This commit is contained in:
@@ -48,14 +48,14 @@ class Subfleet extends BaseModel
|
|||||||
parent::boot();
|
parent::boot();
|
||||||
|
|
||||||
static::creating(function ($model) {
|
static::creating(function ($model) {
|
||||||
if (filled($model->name)) {
|
if (filled($model->type)) {
|
||||||
$model->name = str_replace(' ', '_', $model->name);
|
$model->type = str_replace(' ', '_', $model->type);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
static::updating(function ($model) {
|
static::updating(function ($model) {
|
||||||
if (filled($model->name)) {
|
if (filled($model->type)) {
|
||||||
$model->name = str_replace(' ', '_', $model->name);
|
$model->type = str_replace(' ', '_', $model->type);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user