{"action":"created","issue":{"url":"https://api.github.com/repos/GeneaLabs/laravel-caffeine/issues/40","repository_url":"https://api.github.com/repos/GeneaLabs/laravel-caffeine","labels_url":"https://api.github.com/repos/GeneaLabs/laravel-caffeine/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/GeneaLabs/laravel-caffeine/issues/40/comments","events_url":"https://api.github.com/repos/GeneaLabs/laravel-caffeine/issues/40/events","html_url":"https://github.com/GeneaLabs/laravel-caffeine/issues/40","id":179466871,"number":40,"title":"ServiceProvider path and middlewareGroupExists() error","user":{"login":"jcornil","id":157859,"avatar_url":"https://avatars.githubusercontent.com/u/157859?v=3","gravatar_id":"","url":"https://api.github.com/users/jcornil","html_url":"https://github.com/jcornil","followers_url":"https://api.github.com/users/jcornil/followers","following_url":"https://api.github.com/users/jcornil/following{/other_user}","gists_url":"https://api.github.com/users/jcornil/gists{/gist_id}","starred_url":"https://api.github.com/users/jcornil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcornil/subscriptions","organizations_url":"https://api.github.com/users/jcornil/orgs","repos_url":"https://api.github.com/users/jcornil/repos","events_url":"https://api.github.com/users/jcornil/events{/privacy}","received_events_url":"https://api.github.com/users/jcornil/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/GeneaLabs/laravel-caffeine/labels/high%20priority","name":"high priority","color":"5319e7"},{"url":"https://api.github.com/repos/GeneaLabs/laravel-caffeine/labels/in%20development","name":"in development","color":"0e8a16"},{"url":"https://api.github.com/repos/GeneaLabs/laravel-caffeine/labels/unconfirmed%20bug","name":"unconfirmed bug","color":"f9d0c4"}],"state":"open","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":5,"created_at":"2016-09-27T11:26:47Z","updated_at":"2016-09-27T13:57:51Z","closed_at":null,"body":"Right after the installation of 5.3, I got \"ServiceProvider not found\" error.\r\n\r\nClass 'GeneaLabs\\LaravelCaffeine\\LaravelCaffeineServiceProvider' not found\r\n\r\nI guess service provider path and file name has been changed to...\r\n\r\nGeneaLabs\\LaravelCaffeine\\Providers\\LaravelCaffeineService::class,\r\n\r\nright?\r\n\r\nBut, when I change the path and file name, I get type error.\r\n\r\nType error: Return value of GeneaLabs\\LaravelCaffeine\\Providers\\LaravelCaffeineService::middlewareGroupExists() must be of the type boolean, null returned"},"comment":{"url":"https://api.github.com/repos/GeneaLabs/laravel-caffeine/issues/comments/249872639","html_url":"https://github.com/GeneaLabs/laravel-caffeine/issues/40#issuecomment-249872639","issue_url":"https://api.github.com/repos/GeneaLabs/laravel-caffeine/issues/40","id":249872639,"user":{"login":"jcornil","id":157859,"avatar_url":"https://avatars.githubusercontent.com/u/157859?v=3","gravatar_id":"","url":"https://api.github.com/users/jcornil","html_url":"https://github.com/jcornil","followers_url":"https://api.github.com/users/jcornil/followers","following_url":"https://api.github.com/users/jcornil/following{/other_user}","gists_url":"https://api.github.com/users/jcornil/gists{/gist_id}","starred_url":"https://api.github.com/users/jcornil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcornil/subscriptions","organizations_url":"https://api.github.com/users/jcornil/orgs","repos_url":"https://api.github.com/users/jcornil/repos","events_url":"https://api.github.com/users/jcornil/events{/privacy}","received_events_url":"https://api.github.com/users/jcornil/received_events","type":"User","site_admin":false},"created_at":"2016-09-27T13:57:51Z","updated_at":"2016-09-27T13:57:51Z","body":"Sure...\r\n\r\n<?php namespace GeneaLabs\\LaravelCaffeine\\Providers;\r\n\r\nuse GeneaLabs\\LaravelCaffeine\\Http\\Middleware\\LaravelCaffeineDripMiddleware;\r\nuse Illuminate\\Support\\ServiceProvider;\r\n\r\nclass LaravelCaffeineService extends ServiceProvider\r\n{\r\n    protected $defer = false;\r\n\r\n    public function boot()\r\n    {\r\n        app('router')->group($this->middlewareGroupExists('web')\r\n            ? ['middleware' => 'web']\r\n            : [], function () {\r\n                require __DIR__ . '/../../routes/web.php';\r\n            });\r\n\r\n        $this->publishes([__DIR__ . '/../../config/genealabs-laravel-caffeine.php' => config_path('genealabs-laravel-caffeine.php')], 'genealabs-laravel-caffeine');\r\n    }\r\n\r\n    public function register()\r\n    {\r\n        $this->mergeConfigFrom(__DIR__ . '/../../config/genealabs-laravel-caffeine.php', 'genealabs-laravel-caffeine');\r\n\r\n        app('Illuminate\\Contracts\\Http\\Kernel')->pushMiddleware('\\GeneaLabs\\LaravelCaffeine\\Http\\Middleware\\LaravelCaffeineDripMiddleware');\r\n    }\r\n\r\n    public function provides() : array\r\n    {\r\n        return ['genealabs-laravel-caffeine'];\r\n    }\r\n\r\n    private function middlewareGroupExists(string $group) : bool\r\n    {\r\n        $routes = collect(app('router')->getRoutes()->getRoutes());\r\n\r\n        return $routes->reduce(function ($carry, $route) use ($group) {\r\n            $carry = $carry ?? false;\r\n            $actions = (array) $route->getAction();\r\n\r\n            if (array_key_exists('middleware', $actions)\r\n                && in_array($group, (array) $actions['middleware'])\r\n            ) {\r\n                return true;\r\n            }\r\n\r\n            return $carry;\r\n        });\r\n    }\r\n}\r\n"}}
{"actor":{"display_login":"jcornil"}}