{"action":"created","issue":{"url":"https://api.github.com/repos/the-control-group/voyager/issues/2022","repository_url":"https://api.github.com/repos/the-control-group/voyager","labels_url":"https://api.github.com/repos/the-control-group/voyager/issues/2022/labels{/name}","comments_url":"https://api.github.com/repos/the-control-group/voyager/issues/2022/comments","events_url":"https://api.github.com/repos/the-control-group/voyager/issues/2022/events","html_url":"https://github.com/the-control-group/voyager/issues/2022","id":265584541,"number":2022,"title":"Error when installing Voyager","user":{"login":"o15a3d4l11s2","id":934385,"avatar_url":"https://avatars2.githubusercontent.com/u/934385?v=4","gravatar_id":"","url":"https://api.github.com/users/o15a3d4l11s2","html_url":"https://github.com/o15a3d4l11s2","followers_url":"https://api.github.com/users/o15a3d4l11s2/followers","following_url":"https://api.github.com/users/o15a3d4l11s2/following{/other_user}","gists_url":"https://api.github.com/users/o15a3d4l11s2/gists{/gist_id}","starred_url":"https://api.github.com/users/o15a3d4l11s2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/o15a3d4l11s2/subscriptions","organizations_url":"https://api.github.com/users/o15a3d4l11s2/orgs","repos_url":"https://api.github.com/users/o15a3d4l11s2/repos","events_url":"https://api.github.com/users/o15a3d4l11s2/events{/privacy}","received_events_url":"https://api.github.com/users/o15a3d4l11s2/received_events","type":"User","site_admin":false},"labels":[{"id":469741889,"url":"https://api.github.com/repos/the-control-group/voyager/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-10-15T16:29:58Z","updated_at":"2017-10-19T14:25:38Z","closed_at":null,"author_association":"NONE","body":"- Laravel Version: 5.5.14\r\n- Voyager Version: 1.0.5\r\n- PHP Version: 7.1.3\r\n- Database Driver & Version: MySQL\r\n\r\n### Description:\r\nOn fresh installation of Laravel and Voyager I get the following error:\r\n```\r\n [Illuminate\\Database\\QueryException]                                                                                                                                    \r\n  SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (SQL: alter table `permission_role` add constraint `permission_role_role_id_foreign` foreign ke  \r\n  y (`role_id`) references `roles` (`id`) on delete cascade)  \r\n```\r\nWhen I check the created database there is no table `roles`.\r\n### Steps To Reproduce:\r\nInstall Laravel and then Voyager. Once the command `php artisan voyager:install` is executed, the error shows."},"comment":{"url":"https://api.github.com/repos/the-control-group/voyager/issues/comments/337924762","html_url":"https://github.com/the-control-group/voyager/issues/2022#issuecomment-337924762","issue_url":"https://api.github.com/repos/the-control-group/voyager/issues/2022","id":337924762,"user":{"login":"o15a3d4l11s2","id":934385,"avatar_url":"https://avatars2.githubusercontent.com/u/934385?v=4","gravatar_id":"","url":"https://api.github.com/users/o15a3d4l11s2","html_url":"https://github.com/o15a3d4l11s2","followers_url":"https://api.github.com/users/o15a3d4l11s2/followers","following_url":"https://api.github.com/users/o15a3d4l11s2/following{/other_user}","gists_url":"https://api.github.com/users/o15a3d4l11s2/gists{/gist_id}","starred_url":"https://api.github.com/users/o15a3d4l11s2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/o15a3d4l11s2/subscriptions","organizations_url":"https://api.github.com/users/o15a3d4l11s2/orgs","repos_url":"https://api.github.com/users/o15a3d4l11s2/repos","events_url":"https://api.github.com/users/o15a3d4l11s2/events{/privacy}","received_events_url":"https://api.github.com/users/o15a3d4l11s2/received_events","type":"User","site_admin":false},"created_at":"2017-10-19T14:25:38Z","updated_at":"2017-10-19T14:25:38Z","author_association":"NONE","body":"I don't believe this is related to a glitch. Actually The seed (`PermissionsTableSeeder`) tries to insert `null`:\r\n```\r\nforeach ($keys as $key) {\r\n    Permission::firstOrCreate([\r\n        'key'        => $key,\r\n        'table_name' => null,\r\n    ]);\r\n}\r\n```\r\n\r\nand the `Permissions` table is defined like this:\r\n```\r\nSchema::create('permissions', function (Blueprint $table) {\r\n    $table->increments('id');\r\n    $table->string('key')->index();\r\n    $table->string('table_name');\r\n    $table->timestamps();\r\n});\r\n```\r\n\r\nso the table does not allow null values for column `table_name`."}}
{"actor":{"display_login":"o15a3d4l11s2"}}