'integer', 'speed_rpm' => 'integer', 'feed' => 'decimal:2', 'quantita_fori' => 'integer', ]; protected static function boot() { parent::boot(); static::created(function ($articolo) { if (empty($articolo->qr_code)) { // Formato: id-timestamp (es: 42-1737235200) $articolo->qr_code = $articolo->id . '-' . time(); $articolo->saveQuietly(); } }); } public function getQrUrlAttribute(): string { return $this->qr_code; } }