You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey! my oracle database has several composite primary keys, which forced me to set the $primaryKey of the Models to 'rowid', when I am using the Find method with rowid in string the line in question is returned without problems, however when trying to apply a update in this variable and checking the logs I notice that Laravel tried to apply an update to null
Code snippet of problem
Model:
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class PCPrest extends Model
{
protected $connection = 'oracle';
protected $table = 'pcprest';
protected $keyType = 'string';
protected $primaryKey = 'rowid';
public $timestamps = false;
protected $fillable = ['obs'];
public function cobranca()
{
return $this->hasOne(PCCob::class,'codcob','codcob');
}
}
Render Method (Livewire Controler)
public function render()
{
$prest = PCPrest::where('rowid','AAAYBKAEZAAAA1DAAA')->first();
$prest->update(['obs' => 'teste laravel']); //Error <-- update "PCPREST" set "OBS" = 'teste laravel' where "ROWID" is null
return view('livewire.desdobrar', [
'prestacoes' => BDCPrest::with('bdccartoes')->paginate(25),
]);
}
System details
Operating System: Windows 11
PHP Version: 8.2.17
Laravel Version: 10.48.14
Laravel-OCI8 Version: 10.6.0
Laravel DebugBar
Connection Established
Desdobrar.php#52
select * from (select * from "PCPREST" where "ROWID" = 'AAAYBKAEZAAAA1DAAA') where rownum = 1
83.09ms
OracleBuilder.php#159
update "PCPREST" set "OBS" = 'teste laravel' where "ROWID" is null
660μs
Desdobrar.php#54
select count(*) as aggregate from `bdc_prest`
2.06ms
conciliador
The text was updated successfully, but these errors were encountered:
Summary of problem or feature request
Hey! my oracle database has several composite primary keys, which forced me to set the $primaryKey of the Models to 'rowid', when I am using the Find method with rowid in string the line in question is returned without problems, however when trying to apply a update in this variable and checking the logs I notice that Laravel tried to apply an update to null
Code snippet of problem
Model:
Render Method (Livewire Controler)
System details
Laravel DebugBar
The text was updated successfully, but these errors were encountered: