{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/17275","repository_url":"https://api.github.com/repos/laravel/framework","labels_url":"https://api.github.com/repos/laravel/framework/issues/17275/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/17275/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/17275/events","html_url":"https://github.com/laravel/framework/issues/17275","id":200177959,"number":17275,"title":"[5.4] View Composers are broken","user":{"login":"brunogaspar","id":2285372,"avatar_url":"https://avatars.githubusercontent.com/u/2285372?v=3","gravatar_id":"","url":"https://api.github.com/users/brunogaspar","html_url":"https://github.com/brunogaspar","followers_url":"https://api.github.com/users/brunogaspar/followers","following_url":"https://api.github.com/users/brunogaspar/following{/other_user}","gists_url":"https://api.github.com/users/brunogaspar/gists{/gist_id}","starred_url":"https://api.github.com/users/brunogaspar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brunogaspar/subscriptions","organizations_url":"https://api.github.com/users/brunogaspar/orgs","repos_url":"https://api.github.com/users/brunogaspar/repos","events_url":"https://api.github.com/users/brunogaspar/events{/privacy}","received_events_url":"https://api.github.com/users/brunogaspar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-01-11T18:59:23Z","updated_at":"2017-01-11T23:40:26Z","closed_at":null,"body":"- Laravel Version: 5.4.x-dev 86cf738\r\n- PHP Version: 7.1.0\r\n- Database Driver & Version: _Not relevant_\r\n\r\n### Description:\r\n\r\nView Composers seems completely broken from a week or so to now.\r\n\r\n### Steps To Reproduce:\r\n\r\n```php\r\nview()->composer('*', function ($view) {\r\n    $view->with('currentUser', $this->guard()->user());\r\n});\r\n```\r\n\r\nThe above no longer works but the below works:\r\n\r\n```php\r\nview()->composer('*', function ($viewName, $view) {\r\n    $view[0]->with('currentUser', $this->guard()->user());\r\n});\r\n```\r\n\r\nThe same happens on View Composer classes.\r\n\r\nMaybe this is the expected way to use now? Seems weird heh"},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/272031270","html_url":"https://github.com/laravel/framework/issues/17275#issuecomment-272031270","issue_url":"https://api.github.com/repos/laravel/framework/issues/17275","id":272031270,"user":{"login":"taylorotwell","id":463230,"avatar_url":"https://avatars.githubusercontent.com/u/463230?v=3","gravatar_id":"","url":"https://api.github.com/users/taylorotwell","html_url":"https://github.com/taylorotwell","followers_url":"https://api.github.com/users/taylorotwell/followers","following_url":"https://api.github.com/users/taylorotwell/following{/other_user}","gists_url":"https://api.github.com/users/taylorotwell/gists{/gist_id}","starred_url":"https://api.github.com/users/taylorotwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taylorotwell/subscriptions","organizations_url":"https://api.github.com/users/taylorotwell/orgs","repos_url":"https://api.github.com/users/taylorotwell/repos","events_url":"https://api.github.com/users/taylorotwell/events{/privacy}","received_events_url":"https://api.github.com/users/taylorotwell/received_events","type":"User","site_admin":false},"created_at":"2017-01-11T23:40:26Z","updated_at":"2017-01-11T23:40:26Z","body":"Ah, yeah, that's a by-product of how wildcard events are passed to you now. Will look at cleaning that up for view composers because it doesn't make much sense in that situation.\r\n\r\nBasically, wildcard events signatures now look like:\r\n\r\nEvent::listen('*', function ($eventName, array $eventData) {});\r\n\r\nThis allows you to not have to call Event::firing() etc to get the view name and also be able to get all of the arguments in one array. \r\n\r\nFor view composers of course there is only ever one argument so I'll try to fix it for view composers."}}
{"actor":{"display_login":"taylorotwell"}}