backoffice first commit

This commit is contained in:
2026-07-17 11:34:15 +02:00
parent 761db06329
commit 1c40ef6601
159 changed files with 25830 additions and 7875 deletions
+30
View File
@@ -0,0 +1,30 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Cliente extends Model
{
protected $table = 'clienti';
protected $fillable = [
'nome', 'cognome', 'ragione_sociale', 'email', 'telefono',
'indirizzo', 'cap', 'citta', 'provincia', 'note',
];
public function preventivi(): HasMany
{
return $this->hasMany(Preventivo::class);
}
public function getNominativoAttribute(): string
{
if ($this->ragione_sociale) {
return $this->ragione_sociale;
}
return trim("{$this->nome} {$this->cognome}");
}
}