This commit is contained in:
paoloar77
2024-07-26 17:31:11 +02:00
parent 3690054e94
commit 38933e0e2b
2 changed files with 3 additions and 4 deletions

View File

@@ -6,9 +6,8 @@ use Illuminate\Database\Eloquent\Model;
class Clientegm extends Model class Clientegm extends Model
{ {
protected $primaryKey = 'CodClienteInternet'; // Imposta la chiave primaria corretta protected $primaryKey = null;
public $incrementing = true; // Indica che è auto-incrementante public $incrementing = false;
//protected $connection = 'mysql_test'; //protected $connection = 'mysql_test';
protected $connection = 'sqlsrv_test'; protected $connection = 'sqlsrv_test';
protected $table = 'T_WOO_Clienti'; protected $table = 'T_WOO_Clienti';

View File

@@ -2178,8 +2178,8 @@ Route::get('/testcli', function () {
$cliente->IdNazione = 227; // ITALIA $cliente->IdNazione = 227; // ITALIA
$cliente->IdInternet = 68499; $cliente->IdInternet = 68499;
try { try {
$cliente->save();
dd($cliente); dd($cliente);
$cliente->save();
} catch (\Throwable $th) { } catch (\Throwable $th) {
dd($th); dd($th);
} }