{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/10487","labels_url":"https://api.github.com/repos/laravel/framework/issues/10487/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/10487/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/10487/events","html_url":"https://github.com/laravel/framework/issues/10487","id":109773049,"number":10487,"title":"There is a issue on soft deleting .","user":{"login":"MuhammedRafeeq","id":11055163,"avatar_url":"https://avatars.githubusercontent.com/u/11055163?v=3","gravatar_id":"","url":"https://api.github.com/users/MuhammedRafeeq","html_url":"https://github.com/MuhammedRafeeq","followers_url":"https://api.github.com/users/MuhammedRafeeq/followers","following_url":"https://api.github.com/users/MuhammedRafeeq/following{/other_user}","gists_url":"https://api.github.com/users/MuhammedRafeeq/gists{/gist_id}","starred_url":"https://api.github.com/users/MuhammedRafeeq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MuhammedRafeeq/subscriptions","organizations_url":"https://api.github.com/users/MuhammedRafeeq/orgs","repos_url":"https://api.github.com/users/MuhammedRafeeq/repos","events_url":"https://api.github.com/users/MuhammedRafeeq/events{/privacy}","received_events_url":"https://api.github.com/users/MuhammedRafeeq/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-05T10:56:51Z","updated_at":"2015-10-06T06:08:46Z","closed_at":"2015-10-05T12:43:09Z","body":"customer model\r\n~~~\r\nuse Illuminate\\Database\\Eloquent\\Model;\r\nuse Illuminate\\Database\\Eloquent\\SoftDeletes;\r\n\r\nclass Customer extends Model\r\n{\r\n    use SoftDeletes;\r\n\r\n    protected $fillable  = ['name','place','address'];\r\n\r\n    protected $dates = ['deleted_at','created_at','updated_at','amc_date'];\r\n\r\n    protected $appends = ['amc_or_not','active_or_not','voice_or_not'];\r\n\r\n\r\n    public function User()\r\n    {\r\n        return $this->hasMany('User');\r\n    }    \r\n\r\n    public function Student()\r\n    {\r\n    \treturn $this->hasManyThrough('Student','User');\r\n    }\r\n~~~\r\nuser model\r\n\r\n~~~\r\nuse Illuminate\\Auth\\Authenticatable;\r\nuse Illuminate\\Database\\Eloquent\\Model;\r\nuse Illuminate\\Auth\\Passwords\\CanResetPassword;\r\nuse Illuminate\\Contracts\\Auth\\Authenticatable as AuthenticatableContract;\r\nuse Illuminate\\Contracts\\Auth\\CanResetPassword as CanResetPasswordContract;\r\nuse Illuminate\\Database\\Eloquent\\SoftDeletes;\r\n\r\nclass User extends Model implements AuthenticatableContract, CanResetPasswordContract\r\n{\r\n    use Authenticatable, CanResetPassword;\r\n\r\n    use SoftDeletes;\r\n\r\n    protected $table = 'users';\r\n\r\n\r\n    protected $fillable = ['name', 'email', 'password','mobno','type','active'];\r\n\r\n    protected $hidden = ['password', 'remember_token'];\r\n\r\n    protected $dates = ['deleted_at'];\r\n\r\n    protected $appends = ['usertype'];\r\n\r\n    public function Customer()\r\n    {\r\n        return $this->belongsTo('SmSPortal\\Customer');\r\n    }\r\n~~~\r\n\r\nstudent model\r\n~~~\r\n\r\nuse Illuminate\\Database\\Eloquent\\Model;\r\nuse Illuminate\\Database\\Eloquent\\SoftDeletes;\r\n\r\nclass Student extends Model\r\n{\r\n\tuse SoftDeletes;\r\n\r\n    protected $table = 'studentsdata';\r\n\r\n    protected $dates = ['deleted_at','created_at','updated_at'];\r\n\r\n    protected $fillable = ['admno','name','mobno'];\r\n}\r\n~~~\r\nwhen i perform this query\r\n~~~\r\n$delete = Customer::find($this->customer_id)->Student()->delete();\r\n~~~\r\n\r\ni get the following error\r\n~~~\r\nQueryException in Connection.php line 636:\r\nSQLSTATE[23000]: Integrity constraint violation: 1052 Column 'updated_at' in field list is ambiguous (SQL: update `studentsdata` inner join `users` on `users`.`id` = `studentsdata`.`user_id` set `studentsdata`.`deleted_at` = 2015-10-05 10:46:56, `updated_at` = 2015-10-05 10:46:56 where `studentsdata`.`deleted_at` is null and `users`.`deleted_at` is null and `users`.`customer_id` = 2)\r\n~~~"},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/145750341","html_url":"https://github.com/laravel/framework/issues/10487#issuecomment-145750341","issue_url":"https://api.github.com/repos/laravel/framework/issues/10487","id":145750341,"user":{"login":"MuhammedRafeeq","id":11055163,"avatar_url":"https://avatars.githubusercontent.com/u/11055163?v=3","gravatar_id":"","url":"https://api.github.com/users/MuhammedRafeeq","html_url":"https://github.com/MuhammedRafeeq","followers_url":"https://api.github.com/users/MuhammedRafeeq/followers","following_url":"https://api.github.com/users/MuhammedRafeeq/following{/other_user}","gists_url":"https://api.github.com/users/MuhammedRafeeq/gists{/gist_id}","starred_url":"https://api.github.com/users/MuhammedRafeeq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MuhammedRafeeq/subscriptions","organizations_url":"https://api.github.com/users/MuhammedRafeeq/orgs","repos_url":"https://api.github.com/users/MuhammedRafeeq/repos","events_url":"https://api.github.com/users/MuhammedRafeeq/events{/privacy}","received_events_url":"https://api.github.com/users/MuhammedRafeeq/received_events","type":"User","site_admin":false},"created_at":"2015-10-06T06:08:46Z","updated_at":"2015-10-06T06:08:46Z","body":"this is not a solution .its a bug of laravel eloquent.\r\ncan say how to fix it ??"}}