{"record":{"id":"b563956806a70456","repo":"livewire/livewire","slug":"can-t-set-model-properties-directly-b56395","errorCode":null,"errorMessage":"Can't set model properties directly","messagePattern":"Can't set model properties directly","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/Features/SupportModels/ModelSynth.php","lineNumber":95,"sourceCode":"        // If this model was already resolved by route binding (via\n        // SubstituteBindings middleware), reuse it to avoid a duplicate query.\n        $resolvedModel = app(PersistentMiddleware::class)->getResolvedRouteModel($class, $key);\n\n        if ($resolvedModel) {\n            return $resolvedModel;\n        }\n\n        return $this->makeLazyProxy($class, $meta, function () use ($class, $key) {\n            return (new $class)->newQueryForRestoration($key)->useWritePdo()->firstOrFail();\n        });\n    }\n\n    function get(&$target, $key) {\n        throw new \\Exception('Can\\'t access model properties directly');\n    }\n\n    function set(&$target, $key, $value, $pathThusFar, $fullPath) {\n        throw new \\Exception('Can\\'t set model properties directly');\n    }\n\n    function call($target, $method, $params, $addEffect) {\n        throw new \\Exception('Can\\'t call model methods directly');\n    }\n}\n","sourceCodeStart":77,"sourceCodeEnd":102,"githubUrl":"https://github.com/livewire/livewire/blob/1a3fde34c5789366411c450cf4e630356f18b584/src/Features/SupportModels/ModelSynth.php#L77-L102","documentation":"Error \"Can't set model properties directly\" thrown in livewire/livewire.","triggerScenarios":"Thrown at src/Features/SupportModels/ModelSynth.php:95 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1a3fde34c5789366411c450cf4e630356f18b584","analyzedAt":"2026-08-17T02:02:20.412Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}