{"action":"created","issue":{"url":"https://api.github.com/repos/realrashid/sweet-alert/issues/3","repository_url":"https://api.github.com/repos/realrashid/sweet-alert","labels_url":"https://api.github.com/repos/realrashid/sweet-alert/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/realrashid/sweet-alert/issues/3/comments","events_url":"https://api.github.com/repos/realrashid/sweet-alert/issues/3/events","html_url":"https://github.com/realrashid/sweet-alert/issues/3","id":299670953,"number":3,"title":"Uncaught ReferenceError: swal is not defined","user":{"login":"hoekie","id":2049572,"avatar_url":"https://avatars2.githubusercontent.com/u/2049572?v=4","gravatar_id":"","url":"https://api.github.com/users/hoekie","html_url":"https://github.com/hoekie","followers_url":"https://api.github.com/users/hoekie/followers","following_url":"https://api.github.com/users/hoekie/following{/other_user}","gists_url":"https://api.github.com/users/hoekie/gists{/gist_id}","starred_url":"https://api.github.com/users/hoekie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoekie/subscriptions","organizations_url":"https://api.github.com/users/hoekie/orgs","repos_url":"https://api.github.com/users/hoekie/repos","events_url":"https://api.github.com/users/hoekie/events{/privacy}","received_events_url":"https://api.github.com/users/hoekie/received_events","type":"User","site_admin":false},"labels":[{"id":680889324,"url":"https://api.github.com/repos/realrashid/sweet-alert/labels/help%20wanted","name":"help wanted","color":"128A0C","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-23T10:48:06Z","updated_at":"2018-02-23T15:49:25Z","closed_at":"2018-02-23T14:42:08Z","author_association":"NONE","body":"Hi, Rashid\r\n\r\nI had to wrap the alert in a section: (in this case 'scripts')\r\n\r\n```\r\n@section('scripts')\r\n    @if (alert()->ready())\r\n        <script>\r\n            swal({\r\n                title: \"{!! alert()->message() !!}\"\r\n            });\r\n        </script>\r\n    @endif\r\n@endsection\r\n```\r\n\r\nAnd then add:\r\n\r\n`@yield('scripts')`\r\n\r\nbelow my other script files in the layout template to make it work.\r\nOtherwise a get an Uncaught ReferenceError: swal is not defined error.\r\n\r\nCan you tell me why or is there another workaround to do this?\r\n\r\nThank you for this package!\r\n\r\nRichard\r\n\r\n**Specifications:**\r\n\r\n- PHP Version: 7.1.9\r\n- Laravel Version: 5.6"},"comment":{"url":"https://api.github.com/repos/realrashid/sweet-alert/issues/comments/368047580","html_url":"https://github.com/realrashid/sweet-alert/issues/3#issuecomment-368047580","issue_url":"https://api.github.com/repos/realrashid/sweet-alert/issues/3","id":368047580,"user":{"login":"hoekie","id":2049572,"avatar_url":"https://avatars2.githubusercontent.com/u/2049572?v=4","gravatar_id":"","url":"https://api.github.com/users/hoekie","html_url":"https://github.com/hoekie","followers_url":"https://api.github.com/users/hoekie/followers","following_url":"https://api.github.com/users/hoekie/following{/other_user}","gists_url":"https://api.github.com/users/hoekie/gists{/gist_id}","starred_url":"https://api.github.com/users/hoekie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoekie/subscriptions","organizations_url":"https://api.github.com/users/hoekie/orgs","repos_url":"https://api.github.com/users/hoekie/repos","events_url":"https://api.github.com/users/hoekie/events{/privacy}","received_events_url":"https://api.github.com/users/hoekie/received_events","type":"User","site_admin":false},"created_at":"2018-02-23T15:49:25Z","updated_at":"2018-02-23T15:49:25Z","author_association":"NONE","body":"Thanks @realrashid !\r\n\r\nThat's exactly what I did.\r\n\r\nMaby you should add this to your documentation in order to help newbees like me... ;)\r\n"}}
{"actor":{"display_login":"hoekie"}}