fix minore

This commit is contained in:
Pek5892 2023-12-05 10:33:53 +01:00
parent e752db93c0
commit d57ee7edaa
2 changed files with 13 additions and 8 deletions

View File

@ -33,4 +33,15 @@ class Stato extends Model
{
return $this->hasMany(Intervento::class, 'idstatointervento');
}
public static function build($nome)
{
$model = new static();
$model->codice = 'NEW';
$model->descrizione = $nome;
$model->save();
return $model;
}
}

View File

@ -37,14 +37,8 @@ trait SimpleModelTrait
*
* @return static
*/
public static function build($nome)
public static function build()
{
$model = new static();
$model->codice = 'NEW';
$model->descrizione = $nome;
$model->save();
return $model;
return new static();
}
}