{"action":"created","issue":{"url":"https://api.github.com/repos/GeneaLabs/laravel-caffeine/issues/7","repository_url":"https://api.github.com/repos/GeneaLabs/laravel-caffeine","labels_url":"https://api.github.com/repos/GeneaLabs/laravel-caffeine/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/GeneaLabs/laravel-caffeine/issues/7/comments","events_url":"https://api.github.com/repos/GeneaLabs/laravel-caffeine/issues/7/events","html_url":"https://github.com/GeneaLabs/laravel-caffeine/issues/7","id":103948359,"number":7,"title":"All Views are rendered twice","user":{"login":"lbausch","id":5747127,"avatar_url":"https://avatars.githubusercontent.com/u/5747127?v=3","gravatar_id":"","url":"https://api.github.com/users/lbausch","html_url":"https://github.com/lbausch","followers_url":"https://api.github.com/users/lbausch/followers","following_url":"https://api.github.com/users/lbausch/following{/other_user}","gists_url":"https://api.github.com/users/lbausch/gists{/gist_id}","starred_url":"https://api.github.com/users/lbausch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbausch/subscriptions","organizations_url":"https://api.github.com/users/lbausch/orgs","repos_url":"https://api.github.com/users/lbausch/repos","events_url":"https://api.github.com/users/lbausch/events{/privacy}","received_events_url":"https://api.github.com/users/lbausch/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/GeneaLabs/laravel-caffeine/labels/enhancement","name":"enhancement","color":"0052cc"},{"url":"https://api.github.com/repos/GeneaLabs/laravel-caffeine/labels/help%20wanted","name":"help wanted","color":"bfd4f2"}],"state":"closed","locked":false,"assignee":{"login":"mikebronner","id":1791050,"avatar_url":"https://avatars.githubusercontent.com/u/1791050?v=3","gravatar_id":"","url":"https://api.github.com/users/mikebronner","html_url":"https://github.com/mikebronner","followers_url":"https://api.github.com/users/mikebronner/followers","following_url":"https://api.github.com/users/mikebronner/following{/other_user}","gists_url":"https://api.github.com/users/mikebronner/gists{/gist_id}","starred_url":"https://api.github.com/users/mikebronner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikebronner/subscriptions","organizations_url":"https://api.github.com/users/mikebronner/orgs","repos_url":"https://api.github.com/users/mikebronner/repos","events_url":"https://api.github.com/users/mikebronner/events{/privacy}","received_events_url":"https://api.github.com/users/mikebronner/received_events","type":"User","site_admin":false},"assignees":[{"login":"mikebronner","id":1791050,"avatar_url":"https://avatars.githubusercontent.com/u/1791050?v=3","gravatar_id":"","url":"https://api.github.com/users/mikebronner","html_url":"https://github.com/mikebronner","followers_url":"https://api.github.com/users/mikebronner/followers","following_url":"https://api.github.com/users/mikebronner/following{/other_user}","gists_url":"https://api.github.com/users/mikebronner/gists{/gist_id}","starred_url":"https://api.github.com/users/mikebronner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikebronner/subscriptions","organizations_url":"https://api.github.com/users/mikebronner/orgs","repos_url":"https://api.github.com/users/mikebronner/repos","events_url":"https://api.github.com/users/mikebronner/events{/privacy}","received_events_url":"https://api.github.com/users/mikebronner/received_events","type":"User","site_admin":false}],"milestone":null,"comments":10,"created_at":"2015-08-30T21:00:03Z","updated_at":"2016-09-10T02:41:16Z","closed_at":"2016-06-18T15:53:37Z","body":"This is because calling `$content->render();` in `LaravelCaffeineDripMiddleware.php` on line 28.\r\nI noticed this behaviour because in one of my Views I use `Session::pull()`. The data are pulled during the first rendering and of course no longer available when the View is rendered the second time (and delivered to the client).\r\n\r\nAny suggestions to avoid this?"},"comment":{"url":"https://api.github.com/repos/GeneaLabs/laravel-caffeine/issues/comments/246083507","html_url":"https://github.com/GeneaLabs/laravel-caffeine/issues/7#issuecomment-246083507","issue_url":"https://api.github.com/repos/GeneaLabs/laravel-caffeine/issues/7","id":246083507,"user":{"login":"nfauchelle","id":1188162,"avatar_url":"https://avatars.githubusercontent.com/u/1188162?v=3","gravatar_id":"","url":"https://api.github.com/users/nfauchelle","html_url":"https://github.com/nfauchelle","followers_url":"https://api.github.com/users/nfauchelle/followers","following_url":"https://api.github.com/users/nfauchelle/following{/other_user}","gists_url":"https://api.github.com/users/nfauchelle/gists{/gist_id}","starred_url":"https://api.github.com/users/nfauchelle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfauchelle/subscriptions","organizations_url":"https://api.github.com/users/nfauchelle/orgs","repos_url":"https://api.github.com/users/nfauchelle/repos","events_url":"https://api.github.com/users/nfauchelle/events{/privacy}","received_events_url":"https://api.github.com/users/nfauchelle/received_events","type":"User","site_admin":false},"created_at":"2016-09-10T02:41:16Z","updated_at":"2016-09-10T02:41:16Z","body":"I just ran into this issue, took me a little bit of hunting to pin it down to caffeine!\r\n\r\nWhat I would suggest is two install methods.\r\n1 - Use the Middleware as current.\r\n2 - Manual insertion of something like {!! insert_caffeine_drip() !!} in page body above the </body>\r\n\r\nDoing this would be quite straight forward (roughly)\r\n* Extract out the generation of the javascript to the Helper class in the package\r\n* Make it so the javascript checks for _token tags instead of PHP\r\n* Update the middleware to use that helper\r\n* Setup a function like {!! insert_caffeine_drip() !}} which calls the helper, or just make it so the helper method can be called statically.\r\n\r\nSure it's not AS nice as relying all on the Middleware, but it's a viable alternative until a better solution comes along.\r\n\r\nThoughts?\r\n\r\n"}}
{"actor":{"display_login":"nfauchelle"}}