-
Notifications
You must be signed in to change notification settings - Fork 636
Description
Telescope Version
5
Laravel Version
11
PHP Version
8.2
Database Driver & Version
No response
Description
when I want to save the model, an error occurs
model use multiple primary_key
"message": "array_key_exists(): Argument #1 ($key) must be a valid array offset type",
Steps To Reproduce
DocumentUser::create([
'document_uuid' => $uuid,
'employee_id' => 1
]);
class DocumentUser extends Model
{
protected $primaryKey = ['document_uuid', 'employee_id'];
public $incrementing = false;
}
"message": "array_key_exists(): Argument #1 ($key) must be a valid array offset type",
"exception": "TypeError",
"file": "/var/www/html/api-sed/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php",
"line": 451,
{
"file": "/var/www/html/api-sed/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php",
"line": 451,
"function": "array_key_exists"
},
{
"file": "/var/www/html/api-sed/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php",
"line": 1967,
"function": "getAttribute",
"class": "Illuminate\Database\Eloquent\Model",
"type": "->"
},
{
"file": "/var/www/html/api-sed/vendor/laravel/telescope/src/FormatModel.php",
"line": 25,
"function": "getKey",
"class": "Illuminate\Database\Eloquent\Model",
"type": "->"
},