{"action":"created","issue":{"url":"https://api.github.com/repos/zofe/rapyd-laravel/issues/174","labels_url":"https://api.github.com/repos/zofe/rapyd-laravel/issues/174/labels{/name}","comments_url":"https://api.github.com/repos/zofe/rapyd-laravel/issues/174/comments","events_url":"https://api.github.com/repos/zofe/rapyd-laravel/issues/174/events","html_url":"https://github.com/zofe/rapyd-laravel/issues/174","id":75699699,"number":174,"title":"Bug ? ->mode('readonly');","user":{"login":"Game59","id":188211,"avatar_url":"https://avatars.githubusercontent.com/u/188211?v=3","gravatar_id":"","url":"https://api.github.com/users/Game59","html_url":"https://github.com/Game59","followers_url":"https://api.github.com/users/Game59/followers","following_url":"https://api.github.com/users/Game59/following{/other_user}","gists_url":"https://api.github.com/users/Game59/gists{/gist_id}","starred_url":"https://api.github.com/users/Game59/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Game59/subscriptions","organizations_url":"https://api.github.com/users/Game59/orgs","repos_url":"https://api.github.com/users/Game59/repos","events_url":"https://api.github.com/users/Game59/events{/privacy}","received_events_url":"https://api.github.com/users/Game59/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-12T18:45:52Z","updated_at":"2015-05-16T18:25:13Z","closed_at":"2015-05-16T18:25:13Z","body":"hi, here is the line : \r\n$form->text('id','Transaction ID')->mode('readonly');\r\nand when the form is saved, the id take automaticly the value 0; \r\nLogicaly the error : \r\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY' \r\n\r\nI can simply delete it and all work but maybe I'm doing something wrong ?! I just wanted the Transaction ID to be showed\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/zofe/rapyd-laravel/issues/comments/102664270","html_url":"https://github.com/zofe/rapyd-laravel/issues/174#issuecomment-102664270","issue_url":"https://api.github.com/repos/zofe/rapyd-laravel/issues/174","id":102664270,"user":{"login":"zofe","id":261951,"avatar_url":"https://avatars.githubusercontent.com/u/261951?v=3","gravatar_id":"","url":"https://api.github.com/users/zofe","html_url":"https://github.com/zofe","followers_url":"https://api.github.com/users/zofe/followers","following_url":"https://api.github.com/users/zofe/following{/other_user}","gists_url":"https://api.github.com/users/zofe/gists{/gist_id}","starred_url":"https://api.github.com/users/zofe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zofe/subscriptions","organizations_url":"https://api.github.com/users/zofe/orgs","repos_url":"https://api.github.com/users/zofe/repos","events_url":"https://api.github.com/users/zofe/events{/privacy}","received_events_url":"https://api.github.com/users/zofe/received_events","type":"User","site_admin":false},"created_at":"2015-05-16T18:25:13Z","updated_at":"2015-05-16T18:25:13Z","body":"It's not a bug, read means just not user-editable field, it doesn't mean that it will be autogenerated.\r\nTo proper manage a default value you can use insertValue(), updateValue()  as explained in the wiki.\r\n\r\nExample of custom logic for a primary key using a custom method in the model:\r\n  \r\n    $edit->add('ID', 'ID', 'auto')->insertValue($edit->model->generateID());\r\n\r\n \r\n"}}