{"action":"created","issue":{"url":"https://api.github.com/repos/kodeine/laravel-acl/issues/24","labels_url":"https://api.github.com/repos/kodeine/laravel-acl/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/kodeine/laravel-acl/issues/24/comments","events_url":"https://api.github.com/repos/kodeine/laravel-acl/issues/24/events","html_url":"https://github.com/kodeine/laravel-acl/issues/24","id":62431670,"number":24,"title":"Integrity constraint violation","user":{"login":"subdesign","id":691695,"avatar_url":"https://avatars.githubusercontent.com/u/691695?v=3","gravatar_id":"","url":"https://api.github.com/users/subdesign","html_url":"https://github.com/subdesign","followers_url":"https://api.github.com/users/subdesign/followers","following_url":"https://api.github.com/users/subdesign/following{/other_user}","gists_url":"https://api.github.com/users/subdesign/gists{/gist_id}","starred_url":"https://api.github.com/users/subdesign/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/subdesign/subscriptions","organizations_url":"https://api.github.com/users/subdesign/orgs","repos_url":"https://api.github.com/users/subdesign/repos","events_url":"https://api.github.com/users/subdesign/events{/privacy}","received_events_url":"https://api.github.com/users/subdesign/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-17T15:35:13Z","updated_at":"2015-03-17T16:20:41Z","closed_at":null,"body":"When I try to run the first example in Create Permissions part, I get the following error: \r\n```php\r\nSQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`laravel5`.`permissions`, CONSTRAINT `permissions_inherit_id_foreign` FOREIGN KEY (`inherit_id`) REFERENCES `permissions` (`id`)) (SQL: insert into `permissions` (`name`, `slug`, `description`, `updated_at`, `created_at`) values (user, {\"create\":true,\"view\":true,\"update\":true,\"view.phone\":true,\"delete\":true}, manage user permissions, 2015-03-17 16:33:08, 2015-03-17 16:33:08))\r\n```\r\nI've migrated all tables of course.\r\n\r\nCode is:\r\n```php\r\n\t$permission = new \\Kodeine\\Acl\\Models\\Eloquent\\Permission();\r\n\t$permission->create([ \r\n\t    'name'        => 'user',\r\n\t    'slug'        => [          // pass an array of permissions.\r\n\t        'create'     => true,\r\n\t        'view'       => true,\r\n\t        'update'     => true,\t   \r\n\t        'view.phone' => true,\r\n\t        'delete'     => true   \r\n\t    ],\r\n\t    'description' => 'manage user permissions'\r\n\t]);\r\n```"},"comment":{"url":"https://api.github.com/repos/kodeine/laravel-acl/issues/comments/82442894","html_url":"https://github.com/kodeine/laravel-acl/issues/24#issuecomment-82442894","issue_url":"https://api.github.com/repos/kodeine/laravel-acl/issues/24","id":82442894,"user":{"login":"subdesign","id":691695,"avatar_url":"https://avatars.githubusercontent.com/u/691695?v=3","gravatar_id":"","url":"https://api.github.com/users/subdesign","html_url":"https://github.com/subdesign","followers_url":"https://api.github.com/users/subdesign/followers","following_url":"https://api.github.com/users/subdesign/following{/other_user}","gists_url":"https://api.github.com/users/subdesign/gists{/gist_id}","starred_url":"https://api.github.com/users/subdesign/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/subdesign/subscriptions","organizations_url":"https://api.github.com/users/subdesign/orgs","repos_url":"https://api.github.com/users/subdesign/repos","events_url":"https://api.github.com/users/subdesign/events{/privacy}","received_events_url":"https://api.github.com/users/subdesign/received_events","type":"User","site_admin":false},"created_at":"2015-03-17T16:20:41Z","updated_at":"2015-03-17T16:20:41Z","body":"Updated, but have the same error.\r\n```\r\n  - Removing kodeine/laravel-acl (dev-master 4f6ffd4)\r\n  - Installing kodeine/laravel-acl (dev-master ff4bfec)\r\n    Downloading: 100%       \r\n```"}}