feat: add previous configuration handling for user selections in quotes
- Implemented session storage management for the last configuration choices made by the user. - Added functionality to prompt users when changing models to retain their previous selections. - Introduced methods to apply previous choices to the newly loaded model, including finishes, handles, glass types, and options. - Enhanced user experience by ensuring selections are automatically applied where applicable.
This commit is contained in:
@@ -24,6 +24,27 @@ class Sistema extends Model
|
||||
return $this->hasMany(Modello::class);
|
||||
}
|
||||
|
||||
public function finiture(): HasMany
|
||||
{
|
||||
return $this->hasMany(Finitura::class);
|
||||
}
|
||||
|
||||
public function vetri(): HasMany
|
||||
{
|
||||
return $this->hasMany(Vetro::class);
|
||||
}
|
||||
|
||||
public function regoleVetro(): HasMany
|
||||
{
|
||||
return $this->hasMany(RegolaVetro::class);
|
||||
}
|
||||
|
||||
/** Opzioni del sistema (senza quelle personalizzate per modello). */
|
||||
public function opzioni(): HasMany
|
||||
{
|
||||
return $this->hasMany(Opzione::class)->whereNull('modello_id');
|
||||
}
|
||||
|
||||
public function scopeAttivi(Builder $query): Builder
|
||||
{
|
||||
return $query->where('attivo', true)->orderBy('ordine')->orderBy('id');
|
||||
|
||||
Reference in New Issue
Block a user